As suggested in D27598. This also supports MK_WERROR.clang=no and
MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses.
Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D27601
While here:
- Split synopsis into two parts. The first explains how to record
sessions, while the second one explains how to replay (some of)
the recorded sessions.
- Fix the -width argument of the environment variables list.
MFC after: 1 week
- Ignore malformed directory entries as created by Dropbox ("/").
(rev 1.24)
- Use libarchive 3.x interface: check result for archive_read_free()
and don't call archive_read_close manually. (rev 1.23)
- Always overwrite symlinks on extraction, ever if they're newer than
entries in archive.
- Use getline() rather than getdelim().
PR: 231827
Submitted by: ak
Reviewed by: mm
Obtained from: NetBSD
MFC after: 2 weeks
sockstat can "hang" on getpwuid() calls in situations when FreeBSD
is joined to a directory service (AD/LDAP etc) and the directory
service fail to answer in a timely manner when trying to resolve
numeric UIDs to user names.
Submitted by: Caleb St. John <caleb@ixsystems.com>
MFC after: 1 week
Add two simple examples. In this case I opted to show a small portion of
the output since it helps to understand what the tool does. It shows the use
of the -t flag too.
PR:
Submitted by:
Reported by:
Reviewed by: gbe@
Approved by: manpages (bcr@)
Obtained from:
MFC after:
MFH:
Relnotes:
Security:
Sponsored by:
Differential Revision: https://reviews.freebsd.org/D27543
FreeBSD has used ELF binaries/libraries for decades, but still has some
support for legacy a.out binaries. Portions of this have been retired
over time, but support remained in ldd, ldconfig, and gprof.
Retire gprof support; if anyone needs to do development on a.out
binaries still they will be best served by installing a full FreeBSD 2.x
or other obsolete version in a jail.
Kernel support for executing a.out binaries is unchnaged.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27480
Unconditionally install bsdgrep as grep, bootstrap or not. Remove all
build glue and stop installing both gnugrep and libgnuregex now that
all consumers of the latter are gone.
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27732
When exporting a variable we correctly check all the preconditions that
could make setenv(3) fail. Checking the setenv(3) return value seems
redundant, but given that login(1) is critical, it doesn't hurt to have
a post-check.
This change is based on the "Principles of Secure Coding" course by
Matthew Bishop, PhD., which specifically discusses this code in FreeBSD.
(This change redoes r368776 due to a silly mistake)
When exporting a variable we correctly check all the preconditions that
could make setenv(3) fail. Checking the setenv(3) return value seems
redundant, but given that login(1) is critical, it doesn't hurt to have
a post-check.
This change is based on the "Principles of Secure Coding" course by
Matthew Bishop, PhD., which specifically discusses this code in FreeBSD.
Differential Revision: https://reviews.freebsd.org/D26966
Also centralize and unify checks to enable ASLR stack gap in a new
helper exec_stackgap().
PR: 239873
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Move the include of langinfo.h out of the WITH_ICONV condition block,
since it is not dependent on ICONV. This was correct when nl_langinfo()
had only been called in the WITH_ICONV case, but that is no longer the
case.
Submitted by: yuripv
There was an unprotected use of nl_langinfo() to determine the order of
day vs. month in the generated output.
When building without ICONV support, the order will be: month, day.
yesexpr is an extended regular expression for quite some time now,
use appropriate flag when compiling it.
PR: 238762
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D27509
Add simple example showing the use of the flags: p, t, v
Reviewed by: gbe@, yuripv@
Approved by: manpages (yuripv@)
Differential Revision: https://reviews.freebsd.org/D27541
These values are taken directly from the density report from an
IBM LTO-9 tape drive. (Using mt getdensity)
A LTO-9 drive stores 18TB raw (45TB with compression) on an LTO-9 tape.
lib/libmt/mtlib.c:
Add the LTO-9 density code, and bpmm/bpi values.
usr.bin/mt/mt.1:
Add the LTO-9 density code, bpmm/bpi values and number of
tracks. Bump the man page date.
MFC after: 3 days
Sponsored by: Spectra Logic
Add some examples covering the flags: G, n, P, p, u
Add reference to groups(1)
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D27539
We know up front how many items we can have in the queue (-B/Bflag), so
pay the cost of those particular allocations early on.
The reduced queue maintenance overhead seemed to yield about an ~8%
improvement for my earlier `grep -C8 -r closefrom .` test.
MFC after: 2 weeks
In both cases, print the flag bits first followed by the command.
Output now looks something like this:
(ktrace)
_umtx_op(0x8605f7008,0xf<UMTX_OP_WAIT_UINT_PRIVATE>,0,0,0)
_umtx_op(0x9fffdce8,0x80000003<UMTX_OP__32BIT|UMTX_OP_WAKE>,0x1,0,0)
(truss)
_umtx_op(0x7fffffffda50,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
_umtx_op(0x9fffdd08,UMTX_OP__32BIT|UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D27325
This is addressing cases such as fts_read(3) encountering an [EIO]
from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise be
seen as a successful traversal in some of these cases while silently
discarding expected work.
As noted in r264201, fts_read() does not set errno to 0 on a successful
EOF so it needs to be set before calling it. Otherwise we might see
a random error from one of the iterations.
gzip is ignoring most errors and could be improved separately.
Reviewed by: vangyzen
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27184
r368355 removed the GNU_GREP_COMPAT knob (off by default) and forgot that
bsdgrep may be built/used for bootstrap on some systems.
All base uses should strive to use only POSIX-compliant expressions anyways
and we haven't had libregex by default here up to this point, so just don't
do that if we're bootstrapping.
Note that the resulting binary has the wrong `grep -V` information as it
falsely claims to be GNU compatible, but it is only for bootstrap.
Reported by: GitHub cross-builds via yuripv
This was introduced and then disabled by default primarily to avoid dealing
with bugs in libgnuregex. rS363823 switched to using libregex for it, so
let's just rip the option out now so we can make sure we're getting tested
with libregex via bsdgrep.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D27476
Update libarchive to 3.5.0
Relevant vendor changes:
Issue #1258: add archive_read_support_filter_by_code()
PR #1347: mtree digest reader support
Issue #1381: skip hardlinks pointing to itself on extraction
PR #1387: fix writing of cpio archives with hardlinks without file type
PR #1388: fix rdev field in cpio format for device nodes
PR #1389: completed support for UTF-8 encoding conversion
PR #1405: more formats in archive_read_support_format_by_code()
PR #1408: fix uninitialized size in rar5_read_data
PR #1409: system extended attribute support
PR #1435: support for decompression of symbolic links in zipx archives
Issue #1456: memory leak after unsuccessful archive_write_open_filename
MFC after: 1 week
The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the
parameters passed to strgen.sh in this Makefile. A change to the number
of parameters of strgen.sh has been applied to the invocation of this
command, but this did not cause a rebuild of the generated files.
Reported by: Cy.Schubert@cschubert.com
Crypto file descriptors were added in the original OCF import as a way
to provide per-open data (specifically the list of symmetric
sessions). However, this gives a bit of a confusing API where one has
to open /dev/crypto and then invoke an ioctl to obtain a second file
descriptor. This also does not match the API used with /dev/crypto on
other BSDs or with Linux's /dev/crypto driver.
Character devices have gained support for per-open data via cdevpriv
since OCF was imported, so use cdevpriv to simplify the userland API
by permitting ioctls directly on /dev/crypto descriptors.
To provide backwards compatibility, CRIOGET now opens another
/dev/crypto descriptor via kern_openat() rather than dup'ing the
existing file descriptor. This preserves prior semantics in case
CRIOGET is invoked multiple times on a single file descriptor.
Reviewed by: markj
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27302
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
checks in InitObjdir. Explicit .OBJDIR target always allows
read-only directory.
o More code cleanup and refactoring.
o More unit tests
MFC after: 1 week
* Add examples covering -f, -m and -p flags.
While here, extend the initial description paragraph to note that fstat(1)
will report on all opened files, belonging to processes the user has access to.
The current paragraph may lead to understand that you can get information on
opened files from processes belonging to other users.
Reviewed by: bjk@, danfe@, gbe@
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D26949
* Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w
* While here, change existing wording to use the imperative (remove "To
find")
* Reword first example to be consistent with how grep(1) understand
words (-w)
Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D27264
Let's have two entries in the synopsis:
- chpass now lists options which can be used for non-NIS-specific
functionalities.
- ypchpass additionally lists the NIS-specific flags.
Technically, it is an artificial distinction, as chpass and ypchpass behave
identically. Nevertheless, it might help navigating the synopsis section.
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27251
The synopsis section had two very similar entries. The flags documented by
the first one were a strict subset of the second one. Let's just keep only
the second entry for simplicity.
MFC after: 1 week
The program reads oldsize bytes from oldfile, and proceeds to initialize
a suffix array of oldsize elements using divsufsort(). As per the
function's API [1], array indices 0 through n-1 are initialized.
Later, search() is called, but with index bounds [0, n]. Depending on
the contents of the malloc'd buffer, accessing this uninitialized index
at the end of can result in a segmentation fault. Fix this by passing
oldsize-1 to search(), limiting the search bounds to [0, n-1].
This bug is a result of r303285, which introduced divsufsort() as an
alternate suffix sorting function to the existing qsufsort(). It seems
that qsufsort() did initialize the final empty element, meaning it could
be safely accessed. This difference in the implementations was missed at
the time.
[1] https://github.com/y-256/libdivsufsort
Discussed with: cperciva
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26911
The C.UTF-8 locales is the same as the actual C locale except it does support
the unicode character set. But the collation etc are still the same as the C
locale one.
Reviewed by: many
Approved by: many
Differential Revision: https://reviews.freebsd.org/D26973
Provide a way to ask for an opaque version string for a locale_t, so
that potential changes in sort order can be detected. Similar to
ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is
intended to allow databases to detect when text order-based indexes
might need to be rebuilt.
The CLDR version is extracted from CLDR source data by the Makefile
under tools/tools/locale, written into the machine-generated Makefile
under shared/colldef, passed to localedef -V, and then written into
LC_COLLATE file headers. The initial version is 34.0.
tools/tools/locale was recently updated to pull down 35.0, but the
output hasn't been committed under share/colldef yet, so that will
provide the first observable change when it happens. Other versioning
schemes are possible in future, because the format is unspecified.
Reviewed by: bapt, 0mp, kib, yuripv (albeit a long time ago)
Differential Revision: https://reviews.freebsd.org/D17166
Lots of new unit-tests increase code coverage.
Lots of refactoring, cleanup and simlpification to reduce
code size.
Fixes for Bug 223564 and 245807
Updates to dirdeps.mk and meta2deps.py
This prevents LANG= in an included file from affecting the interpretation
of month and day names in the including file.
Make the internal pre-processor accept white space between the "#" at
the start of the line and the keyword for better compatibility with cpp.
Add support for the cpp keywords #warning and #error.
MFC after: 3 days
Fix one case where #else was not corerctly processed and simplify the
conditions logic.
Fix parsing of day and month names in the locale specified in the calendar
file. The previous version would expect those names to match the locale of
the user.
Mention that comments are now correctly processed and that // is supported
in addition to /* ... */.
MFC after: 3 days
Since elftoolchain's cxxfilt is rather far behind on features, and we
ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
replacement.
It supports the same options as elftoolchain cxxfilt, though it doesn't
have support for old ARM (C++ Annotated Reference Manual, not the CPU)
and GNU v2 manglings. But these are irrelevant in 2020.
Note: as we already compile the required libraries as part of libllvm,
this will not add any significant build time either.
PR: 250702
Reviewed by: emaste, yuri
Differential Revision: https://reviews.freebsd.org/D27071
MFC after: 2 weeks
Calendar files that specify LANG=... to specify their character encoding did
also set the date format defined for that locale, resulting in output like:
Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924
4 nov. N'oubliez pas les Charles !
After this commit the output is always printed in a consistent format
according to the user's current locale, e.g.:
Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924
Nov 4 N'oubliez pas les Charles !
I'll open a review asking for opinions whether this format change should
be merged to -STABLE.
Relnotes: yes
This fixes two warnings:
* double-definition of a symbol in a yacc header
* Comparison of an unsigned int being >= 0; that's always
going to be true.
Reviewed by: imp, rscheff
Differential Revision: https://reviews.freebsd.org/D27036
Add line number information to more warning and error messages.
Detect #else and #endif without corresponing #ifdef/#ifndef as error.
Detect missing #endif at end of file and print warning but continue.
Support for #undef has been added to reverse the effect of a prior #define.
It is no error if the argument value has not been defined before.
These changes may cause error aborts on malformed input files (e.g. with
spurious #else or #endif), but no such errors exist in the calendar files
in the FreeBSD base system and the calendar-data port and all tests pass.
More tests will be added in a follow-up commit to detect regressions that
might affect the newly added features.
This commit ends a series of updates that enhance the pre-processor and
make it behave much more like prior versions of the calendar progarm that
called cpp to pre-process the data files.
MFC after: 3 days
Relnotes: yes
The calendar program used to output entries in reverse order, due to the
way an internal linked list was built up.
A regression test with 2 entries for the same day has been adapted to the
now non-reversed order.
MFC after: 3 days
The internal pre-processor ignored lines that did not parse a calendar
entries, but did not support multi-line comments in the way the external
cpp did.
The calendar files distributed with the base system (now in a port) do
use comments, though.
Implement comment processing for single-line (//) and multi-line comments
(/* */) with same semantics as in a standard C pre-processor.
All tests pass with this version, but there are no tests that specifically
verify comment processing.
Reported by: jhs@berklix.com (Julian H. Stacey)
MFC after: 3 days
Very small EXAMPLES section.
While here, remove reference to nroff(1).
Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26947
While here, move the date to keep 2 weeks ahead notificaion
and fix the part of speech.
Reviewed by: debdrup
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26998
The existing code performed a chdir() into the home directory, but the
parser fell back to using the invoking user's home directory as the base
directory for the search for an include file.
Since use of the -a option is limited to UID==0, the directory searched
was typically ~root/.calendar, not the .calendar directory of the user
whose file is being processed.
PR: 205580
Reported by: greg.bal4@gmail.com (Greg Balfour)
MFC after: 3 days
The previous behavior was to support nested #ifdef and #ifndef, but to
return to unconditional parsing after the next #endif, independently of
the number of previously parsed conditions.
E.g. after "#ifdef A / #ifdef B / #endif" the following lines were
unconditially parsed again, independently of A and/or B being defined.
The new behavior is to count the level of false conditions and to only
restart parsing of calendar entries when the corresponding number of
#endif tokens have been seen.
In addition to the above, an #else directive has been added, to toggle
between parsing and ignoring of the following lines.
No validation of the correct use of the condition directives is made.
#endif without prior #define or #ifndef is ignored and #else toggles
between parsing and skipping of entries.
The MFC period has been set to 1 month to allow for a review of the
changes and for a discussion, whether these modifications should not
be merged at all.
No correct input file is parsed differently than before, but if calendar
data files are published that use these new features, those data files
will not parse correctly on prior versions of this program.
MFC after: 1 month
Foundation copyrights, approved by emaste@. It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.
Reviewed by: emaste, imp, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D26980
The convention in this program is to parse the line immediately starting
after the token (e.g. #defineA and #ifdefA define respectively look-up "A"),
and this commit restores this behavior instead of skipping an assumed
white-space character following #ifdef.
Reported by: kevans
MFC after: 3 days
There was code to process an #ifndef tokens, but none for #ifdef.
The #ifdef token was mentioned as unsupported in the BUGS section,
but no reason was given and I do not see why it should stay omitted.
Misleading information in The BUGS section of the man-page regarding
the maximum number of #define and #include statements supported has
been removed. These limits might have applied to a prior version of
this program, but do not seem to apply to the current implementation.
I have not tried to test for the existence of the limits, but the
include file processing just recursively calls the parser (without
counting the recursion depth) and the stringlist functions do not
impose a limit on the number of entries.
Reported by: jhs@berklix.com
MFC after: 3 days
It turns out that examples were incorrectly referring to Volume_Up
and Volume_Down, which are not defined at all.
PR: 250683
Reported by: corvid%openmailbox.org
MFC after: 2 weeks
Instead, leave the fomat as unspecified (if it hasn't been) and use the
-p flag as a hint to 'context' if no other formatting option is specified.
This fixes `diff -purw`, used frequently by emaste, and matches the behavior
of its GNU counterpart.
PR: 250015
Reviewed by: emaste
MFC after: 1 week
Literal references to /usr/local exist in a large number of files in
the FreeBSD base system. Many are in contributed software, in configuration
files, or in the documentation, but 19 uses have been identified in C
source files or headers outside the contrib and sys/contrib directories.
This commit makes it possible to set _PATH_LOCALBASE in paths.h to use
a different prefix for locally installed software.
In order to avoid changes to openssh source files, LOCALBASE is passed to
the build via Makefiles under src/secure. While _PATH_LOCALBASE could have
been used here, there is precedent in the construction of the path used to
a xauth program which depends on the LOCALBASE value passed on the compiler
command line to select a non-default directory.
This could be changed in a later commit to make the openssh build
consistently use _PATH_LOCALBASE. It is considered out-of-scope for this
commit.
Reviewed by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D26942
- Sort flags
- Stylize incr|+ and decr|- properly
- Add a missing period at the end of the description
- Use the standard layout for the EXAMPLES section (remove the list macro
and add indentation to the code block)
Move all the data files for the calendar(1) program, except
calendar.freebsd to the calendar-data package. When a file
can't be found, and /usr/local/share/calendar doesn't exist
provide a helpful hint to install this package.
Reviewed by: se@
Differential Revision: https://reviews.freebsd.org/D26926
Make the Ethernet PCP codepoint configurable
for L2 local traffic, to allow lower latency for
iSCSI block IO. This addresses the initiator
side only.
Reviewed by: mav, trasz, bcr
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26739
libjail is pretty small, so it makes for a good proof of concept demonstrating
how a system library can be wrapped to create a loadable Lua module for flua.
* Introduce 3lua section for man pages
* Add libjail module
Reviewed by: kevans, manpages
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26080
Ever since r192762 nfsstat has included a few fields whose values were
always 0. They were copied from OpenBSD, but have never been used on
FreeBSD. Don't display them.
Reviewed by: rmacklem
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26920
Calendar files in /usr/lcoal/share/calendar take precedence over files in
the base system. They can be provided by a port or package, but since such
a port has not been committed, yet, no specific port name is suggested.
In fact, multiple ports could exist (e.g. per locale) without conflicting
with each other.
Calendar files in LOCALBASE override similarily named ones in the base
system. This could easily be changed if the base system calendars should
have precedence, but it could lead to a violation of POLA since then the
port's files were ignored unless those in base have been deleted.
There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses
of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease
a consistent modification of this prefix.
Reviewed by: imp, pfg
Differential Revision: https://reviews.freebsd.org/D26882
Add a small example.
Cross reference clean up for colcrt, nroff and tbl.
Reviewed by: gbe@, bcr@
Approved by: gbe@
Differential Revision: https://reviews.freebsd.org/D26864
Pad the icmp6stat structure so that we can add more counters in the
future without breaking compatibility again, last done in r358620.
Annotate the rarely executed error paths with __predict_false while
here.
Reviewed by: bz, melifaro
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26578
Not that you can regenerate the motd by editing motd.template and
running 'service motd restart' rather than rebooting.
Small wordsmithing by me, and updated the example from FreeBSD 2.1.6.1
release to 12.1 release.
Submitted by: Dan Mack
It turns out that the majority of the test time for the mkimg tests isn't
mkimg itself but rather the use of jot and hexdump which can be quite slow
on emulated platforms such as QEMU.
On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655
seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25%
of the time for the entire testsuite!) since jot ends up triggering slow
functions inside the QEMU emulation a lot.
Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D26796
According to git blame the trymmap() function was added in 1996 to skip
mmap() calls for NFS file systems. However, nowadays mmap() should be
perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems
were whitelisted so we don't use mmap() on ZFS. It also prevents the use
of mmap() when bootstrapping from macOS/Linux since on those systems the
trymmap() function was always returning zero due to the missing MFSNAMELEN
define.
This change keeps the trymmap() function but changes it to check whether
using mmap() can reduce the number of system calls that are required.
Using mmap() only reduces the number of system calls if we need multiple read()
syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more expensive
than read() so this sets the threshold at 4 fewer syscalls. Additionally, for
larger file size mmap() can significantly increase the number of page faults,
so avoid it in that case.
It's unclear whether using mmap() is ever faster than a read with an appropriate
buffer size, but this change at least removes two unnecessary system calls
for every file that is installed.
Reviewed By: markj
Differential Revision: https://reviews.freebsd.org/D26041
- When flushing extra lines after all input has been processed, make
sure that local state is reinitialized correctly.
- When -f is specified, make sure to end output with a full newline.
- Fix some style issues and update comments.
- Add some regression tests.
PR: 249308
Submitted by: Yang Zhong <yzhong@freebsdfoundation.org>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26536
Allow the DSCP codepoint also to be configurable
for the traffic in the direction from the initiator
to the target, such that writes and any requests
are also treated in the appropriate QoS class.
Reviewed by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26714
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order
- normalizing date format
- AUTHORS section without An macro
`cpuset -g -x N` along with requested information always prints
message `cpuset: getdomain: Invalid argument'. The EINVAL is returned
from kern_cpuset_getdomain(), since it doesn't expect CPU_LEVEL_WHICH
and CPU_WHICH_IRQ parameters.
To fix the error, do not call cpuset_getdomain() when `-x' is specified.
MFC after: 1 week
Adding the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.
This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible.
Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26518
colcrt(1) and nroff(1) where removed in r319664.
Remove references to these commands in ul(1) man page.
PR: 244127
Reported by: freebsd@tim.thechases.com
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D2614
Improve friendlyness of the command line by accepting the percent brightness
in both format: with or without a trailing '%'
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D26692
Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
normally skipped for cost reasons.
This makes it so the names/descriptions of those sysctls can be discovered with
sysctl -aN/sysctl -ad/sysctl -at.
It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
is explicitly requested.
The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that
the extensive and expensive stats are skipped by default but may still be easily
obtained without having to know them all (which may not even be possible) and
request each one-by-one.
Reviewed by: jhb
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26560
* Add some examples showing binary, arguments and file info from living
processes.
* Show information from core dumps including an attempt using an old core file.
* While here, fix warning 'no blank before trailing delimiter' reported by igor.
Approved by: manpages (0mp@)
Differential Revision: https://reviews.freebsd.org/D25467
This change is based on the nexthop objects landed in D24232.
The change introduces the concept of nexthop groups.
Each group contains the collection of nexthops with their
relative weights and a dataplane-optimized structure to enable
efficient nexthop selection.
Simular to the nexthops, nexthop groups are immutable. Dataplane part
gets compiled during group creation and is basically an array of
nexthop pointers, compiled w.r.t their weights.
With this change, `rt_nhop` field of `struct rtentry` contains either
nexthop or nexthop group. They are distinguished by the presense of
NHF_MULTIPATH flag.
All dataplane lookup functions returns pointer to the nexthop object,
leaving nexhop groups details inside routing subsystem.
User-visible changes:
The change is intended to be backward-compatible: all non-mpath operations
should work as before with ROUTE_MPATH and net.route.multipath=1.
All routes now comes with weight, default weight is 1, maximum is 2^24-1.
Current maximum multipath group width is statically set to 64.
This will become sysctl-tunable in the followup changes.
Using functionality:
* Recompile kernel with ROUTE_MPATH
* set net.route.multipath to 1
route add -6 2001:db8::/32 2001:db8::2 -weight 10
route add -6 2001:db8::/32 2001:db8::3 -weight 20
netstat -6On
Nexthop groups data
Internet6:
GrpIdx NhIdx Weight Slots Gateway Netif Refcnt
1 ------- ------- ------- --------------------------------------- --------- 1
13 10 1 2001:db8::2 vlan2
14 20 2 2001:db8::3 vlan2
Next steps:
* Land outbound hashing for locally-originated routes ( D26523 ).
* Fix net/bird multipath (net/frr seems to work fine)
* Add ROUTE_MPATH to GENERIC
* Set net.route.multipath=1 by default
Tested by: olivier
Reviewed by: glebius
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26449
This tool is used to configure registered backlights.
It can incr/decr (default to 10%) or accept a percentage value directly.
Reviewed by: manpages (gbe@)
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26251
zgrep should exit with success when given multiple files and the
pattern is found in at least one file. Prior to this change,
it would exit with success only if the pattern was found in _every_ file.
Reviewed by: dab ngie
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26616
This version incorporates many fixes in particular a fix for vi -w
Another approach was proposed to merge those fixes (see review), I find
it easier to track changes if we keep importing snapshot on regular
basis
PR: 241985
Reported by: fernape
Differential Revision: https://reviews.freebsd.org/D26158
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.
Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
root's calendar files three times, once each for root, toor and
daemon.
This relates to bug 246943, but does not solve it. See discussion in
bug report for more details.
PR: 246943
Reported by: wcarson.bugzilla@disillusion.net
Basically it reverts one chunk that reversed the parsing logic, making
legacy variants of invocation, like `procstat -a -f', non-operational.
Reported and tested by: Dewayne Geraghty <dewayne@heuristicsystems.com.au>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Add EXAMPLES section showing the use of -a and -s flags and how which(1)
treates duplicates.
Approved by: manpages (gbe@)
Differential Revision: https://reviews.freebsd.org/D26182
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).
Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.
Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.
There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.
Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455
Intent is to mimic Solaris commands with the same names.
Submitted by: Juraj Lutter <juraj@lutter.sk>
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26310
- Exit with an error if no path is specified.
- Man page typo.
- Error message typo.
Reviewed by: kib
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26376
* Remove identical or almost identical headers
* Only build aout.c on amd64 and i386. None of the the other current
architectures ever supported running a.out binaries
* Enable on all architectures
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D26369
Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run
on any 64-bit Arm instruction set. This will simplify checks in downstream
consumers targeting prototype instruction sets.
The only place we check for MACHINE_ARCH == aarch64 is when building the
device tree blobs. As these are targeting current generation ISAs.
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D26370
This would allow interested parties to do experimental runs with an
environment set appropriately to raise all the warnings throughout the
build; e.g. env WARNS=6 NO_WERROR=yes buildworld.
Not currently touching the numerous instances in ^/tools.
MFC after: 1 week
We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.
Tested by: andrew
Differential Revision: https://reviews.freebsd.org/D16761
Main changes:
* Vim-style expandtab option
* Provides Turkish translation
* Backspace now deletes \ rather than being escaped
* T during motion commands is now VI-compatible
* Encoding related fixes, such as UTF-8 detection
* Fixed a number of memory management issues
MFC after: 3 weeks
Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.
Other significant changes:
o new read-only variable .SHELL which provides the path of the shell
used to run scripts (as defined by the .SHELL target).
o variable parsing detects more errors.
o new debug option -dl: LINT mode, does the equivalent of := for all
variable assignments so that file and line number are reported for
variable parse errors.
Due to a copy/paste error, the "getacl" field was duplicated, but only in
XML or JSON mode, not in txt mode.
Discussed with: rmacklem
MFC after: 1 week
Sponsored by: Axcient
In the util-linux version of script, it will always exit with succes.
Except when run with -e, in which case it will have the exit value of
the child. BSD Script already uses the child's exit value for its exit
value. Some config and other helper scripts depend on being able to
specify -e. Accept it for compatibility since we'll already to the
right thing, but otherwise we ignore it.
When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.
Submitted by: Bret Ketchum
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26232
Add EXAMPLES section covering all the flags except -m and -bTu covered by
other flags.
Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26219
By default, lockf(1) opens its lock file O_RDONLY|O_EXLOCK. On NFS, if the
file already exists, this is split into opening the file read-only and then
requesting an exclusive lock -- and the second step fails because NFS does
not permit exclusive locking on files which are opened read-only.
The new -w option changes the open flags to O_WRONLY|O_EXLOCK, allowing it
to work on NFS -- at the cost of not working if the file cannot be opened
for writing.
(Whether the traditional BSD behaviour of allowing exclusive locks to be
obtained on a file which cannot be opened for writing is a good idea is
perhaps questionable since it may allow less-privileged users to perform
a local denial of service; however this behaviour has been present for a
long time and changing it now seems like it would cause problems.)
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D26005
The most awkward bit in this patch is the bootstrapping of m4:
We can't simply use the host version of m4 since that is not compatible
with the flags passed by lex (at least on macOS, possibly also on Linux).
Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also
depends on lex (which needs m4 to generate any files). To work around this
cyclic dependency we can build a bootstrap version of m4 (with pre-generated
files) then use that to build the real m4.
This patch also changes the xz/unxz/dd tools to always use the host version
since the version in the source tree cannot easily be bootstrapped on macOS
or Linux.
Reviewed By: brooks, imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D25992
Add small example section showing general use and -d and -h flags
Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26172
Every version of patch since the first one posted to mod.sources in 1985 have
included a heuristic for coping with the state of email messaging at the
time. This heuristic would add up to 4 blank lines to a patch if it thought it
needed it. The trouble is, though this causes at least one bug.
The bug in my case is that if you have a context diff whose last hunk only
deletes 3 or fewer lines, then if you try to reverse apply it with -R, it will
fail. The reason for this is the heuristic builds an internal representation
that includes those blank lines. However, it should really replicate the lines
from the pattern lines line it would any other time, not assume they are blank
lines. Removing this heuristic will prevent patch from misapplying the lines
removed after applying a 'fuzz' factor to the previous blank line in the file. I
believe this will only affect 'new-style' 4.3BSD context diffs and not the
older-style 4.2BSD diffs and plain, non-context diffs. It won't affect any of
the newer formats, since they don't use the 'omitted' construct in the same way.
Since this heuristic was put into patch at a time when email / etc ate trailing
white space on a regular basis, and since it's clear that this heuristic is the
wrong thing to do at least some of the time, it's better to remove it
entirely. It's not been needed for maybe 20 years since patch files are not
usually corrupted. If there are a small number of patch files that would benefit
from this corruption fixing, those already-currupt patches can be fixed by the
addition of blank lines. I'd wager that no one will ever come to me with an
example of a once-working patch file that breaks with this change. However, I
have 2 patches from the first 195 patches to 2.11BSD that are affected by this
bug, suggesting that the relative frequency of the issue has changed
signficantly since the original heuristic was put into place.
Reviewed by: phk@
Differential Revision: https://reviews.freebsd.org/D26081
- a couple of descriptions are incomplete
- synopsis doesn't show that all arguments are optional
- missing an ENVIRONMENT section with TERM mentioned
PR: 84670
Submitted by: Gary W. Swearingen <garys at opusnet dot com>
Reviewed by: bcr
Approved by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26009
- Instead of using isatty() to decide whether to call tcgetattr(), just
call tcgetattr() directly, since that's all that isatty() does anyway.
- Simplify error handling in termset(). Check for errno != ENOTTY from
tcgetattr() to handle errors that may be raised while running
script(1) under a debugger.
PR: 248377
Submitted by: Soumendra Ganguly <soumendraganguly@gmail.com>
MFC after: 1 week
My change to allow bootstrapping pwd_mkdb (r363992) resulted in i386 build
failures because the bootstrap header was being included in non-bootstrap chpass.
Dropping the no longer required pwd_mkdb include path from chpass fixes
the build, but to be certain that the failure doesn't get re-introduced,
I've also moved the bootstrap pwd.h into a subdirectory so that adding
-I${SRCTOP}/usr.sbin/pwd_mkdb doesn't pull it in.
Reported by: mjg
Otherwise recorded sessions of some interactive programs do not play
back properly.
PR: 248377
Submitted by: Soumendra Ganguly <0.gangzta@gmail.com>
MFC after: 1 week