Some of ARC statistic sysctls changed years ago, but those tools
are still using legacy shims, that are going to be removed.
Approved by: re (cperciva)
(cherry picked from commit 8aad1e6148d3389df100bb0391e2d3a909f26ecf)
(cherry picked from commit f23326ff2c7cad9579061291b6de7feb5ea7302a)
The first attempt at addressing this simply suppressed SIGPIPE, which
resulted in mandoc printing out error messages instead. This was then
reverted, but the pipefail was (correctly) left in, so man still
returned a nonzero exit code if you quit a page before the end.
Approved by: re (cperciva)
PR: 223516, 279542
Fixes: 14a5c1068d37, a85d870007e7
MFC after: 1 week
Reviewed by: ziaee, kevans
Differential Revision: https://reviews.freebsd.org/D50302
(cherry picked from commit fbaba7aa432257a9b787edc6bfdbfbde94f2e0d5)
(cherry picked from commit 2f99190a9234b119bcec1e4645e87d4e6016e5a5)
Add a missing space before R-HIWA to align the table header with
the table contents.
Reviewed by: rrs, cc
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D49941
(cherry picked from commit 4294f7946e4cd8face2bfa16cedc5c0bf0d6c81e)
If we get EOPNOTSUPP from open() failing, then it may just be that we're
looking at a unix(4) socket instead of a normal file/device or whatnot.
Fallback to trying to open it as a unix(4) socket, which is a useful
feature that doesn't add much complexity.
Reviewed by: des, emaste, markj
(cherry picked from commit 1b3748977f28c70e0b161fb476bf4e075bcc5940)
This effectively reverts
6e824f3713011 ("time: siginfo_recvd needs to be marked volatile")
because it was actually wrong. Switch to C11 signal fence, which
provides a compiler barrier that will do the right thing.
Reported by: kib
Reviewed by: kib (slightly earlier version)
(cherry picked from commit df1b0f580d3dc4dd165d84fbcc14d0eebd8ee2c4)
Err on the side of caution and revert to the BSD-style getopt(3)
behavior for argument processing, as it's harder to go back and it's
not clear that this was strictly intentional.
This is the difference between allowing `base64 /COPYRIGHT -w 80` and
forcing `base64 -w 80 /COPYRIGHT`.
Reviewed by: emaste, pstef
(cherry picked from commit d8fd551438706b3766da23e72ef077945ba43cd3)
Pull the open flags out of the loop into a local var. They won't be
changing, so this is marginally more readable.
Adds some extra brackets around the loop in preparation for a future
change that may try to fallback to opening the path as a socket if we
get an EOPNOTSUPP.
No functional change.
Reviewed by: asomers, des, emaste, ngie
(cherry picked from commit 414c2b8d1e5abe7186c1aa4dc3ab28147ce46f47)
The cases are ordered in such a way that we naturally progress through
the functionality, with the earliest failures perhaps shedding light on
any later failures.
sysutils/porch is used for one test if it's available, just to cleanly
check that SIGINT is being ignored properly.
Reviewed by: des, emaste
(cherry picked from commit 85ff0b08ee699ff323404727998993275b4d2e2a)
top was added in 511d9c6565 for FreeBSD 2.2.2.
MFC after: 3 days
Reviewed by: carlavilla, imp, joerg
Approved by: carlavilla (mentor)
Differential Revision: https://reviews.freebsd.org/D49591
(cherry picked from commit a9f5dcf82941e7e211490432b93bd124e7c0a57d)
This marks the start of the FreeBSD 14.3 release cycle; the stable/14
tree is now in "code slush".
Developers are encouraged to prioritize fixing bugs (and/or merging bug
fixes from HEAD) over new features at this time. Commit approval from
re@ is not required but if new features introduce problems they may be
removed from the release.
Approved by: re (implicit)
Sponsored by: Amazon
For the default uncolored output, we'll just output a line once and then
move on. For colored output, we'll output multiple matches per
line with context from the line interspersed and may end up writing out
some match context multiple times as we don't persist which part of the
lines have already been printed.
Fix it by tracking the length of line printed thus far in printline()
and retaining it across successive calls to printline() in the same
line. printline() should indicate whether it terminated the line or not
to avoid tracking the logic for that in multiple places: -o lines are
always terminated, so it's generally only some --color contexts where we
wouldn't have terminated.
Add a test to make sure that we're only printing one line going forward.
Reported and tested by: Jamie Landeg-Jones <jamie catflap org>
Reviewed by: emaste
(cherry picked from commit 4c9ffb13dd74159bd3ed7e1c4c706dbd15a70df2)
This flag is used in field 'cr_flags', which is never directly visible
outside the kernel. That field is however exported through 'struct
kinfo_proc' objects (field 'ki_cr_flags'), either from the kernel via
sysctls or from libkvm, and is supposed to contain exported flags
prefixed with KI_CRF_ (currently, KI_CRF_CAPABILITY_MODE and
KI_CRF_GRP_OVERFLOW, this second one being a purely userland one
signaling overflow of 'ki_groups').
Make sure that KI_CRF_CAPABILITY_MODE is the flag actually exported and
tested by userland programs, and hide the internal CRED_FLAG_CAPMODE.
As both flags are currently defined to the same value, this doesn't
change the KBI, but of course does change the KPI. A code search via
GitHub and Google fortunately doesn't reveal any outside uses for
CRED_FLAG_CAPMODE.
While here, move assignment of 'ki_uid' to a more logical place in
kvm_proclist(), and definition of XU_NGROUPS as well in 'sys/ucred.h'
(no functional/interface changes intended).
Reviewed by: mhorne
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46909
(cherry picked from commit 09290c3a0c82524138973b14f393379edf733753)
A ports exp-run (PR 283410) showed one port to be affected
(sysutils/procs), which has been fixed upstream and in the ports tree.
All additional indirect references to CRED_FLAG_CAPMODE we found after
the code search mentioned in the original commit message are
automatically generated from our headers by FFI mechanisms, so
automatically disappear at recompilation (and the KBI is not changed, as
explained above, so recompilation is not needed).
AFMT_FLOAT is supported by sound(4) as of FILLME, so use it here, since
the whole program works with floats already.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47639
(cherry picked from commit 1166cfd96f3403edb082387fbc3a4d4aa249bce8)
As this is the only system call that MAC/do currently supports, and the
only one that really can be for transitions involving simultaneous
changes of user and group IDs.
Reviewed by: bapt
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47621
(cherry picked from commit e395e354823b690ba19ecc8e3688bacec6f67ad3)
strings(1) is not conditional on WITH_/WITHOUT_TOOLCHAIN, as it is a
small utility that is also useful outside of the toolchain context.
As of commit 1cae7121c667 we switched to WITH_LLVM_BINUTILS by default.
After this change building world with default options but installing
WITHOUT_TOOLCHAIN failed, because we would build LLVM's strings but
attempt to install ELF Tool Chain's version, which did not exist.
Address this by always including ELF Tool Chain strings in non-install
make targets, so that it will be available if options are changed at
install time.
PR: 285556
Reported by: Michael Butler
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49425
(cherry picked from commit fdc4db57224ce19b867c60fce4c410068be40c27)
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
Switching between io and cpu sorting uses a great example in the usage.
[-m io | cpu]. Use that everywhere.
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49515
(cherry picked from commit 187d954eab94fdcb33609d91966dbd727acfd720)
Organize key bindings by ascii(7) for consistency and maintainability,
mark them as Interactive Commands, wordsmith them, and sync their
organization between the manual and help screen.
MFC after: 3 days
PR: 282734
Fixes: c8aa5e526 (move command mapping to commands.c)
Reviewed by: imp, mhorne, Jim Brown <jpb@jimby.name>
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49462
(cherry picked from commit 0a85254d5a33800600477ce57fbaab64591aa6ea)
Printing the file name doesn't make sense since mkstemp failing means
that the file wasn't created.
Also add a test case for this.
Co-authored-by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp,jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1383
(cherry picked from commit e8d027be6b84ac976eacd46283c286b934dd6f1f)
+ correct misfile in section 8
+ rewrite the document descirption to include -9660
+ markup command modifiers as such instead of bold
+ markup variables as defined variables, enabling apropos
+ correct option syntax in description section
+ unwrap list offsets for legibility
+ fix line wrapping for standard BSD console
+ crossreference cd9660(5) and vis versa
+ tag SPDX for both manuals
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D48513
(cherry picked from commit 283be95ea29abd7f867e4084bafe368c47f6c038)
Notably:
* spell "Megabytes" as "megabytes" consistently;
* remove a stray asterisk from the /boot/kernel/kernel listing
* avoid using a shell prompt in the examples consistently
* fixes the size parameter
* add an example how to increase the file size
PR: 273997
MFC after: 1 week
(cherry picked from commit 5460bdda9d4cb3ce1d7431824b6f53c545888b53)
I very occasionally see test failures caused by the total CPU time being
several milliseconds under 3s. The test runs "limits -t 3 time <busy
loop>" and verifies that the reported time elapsed is at least 3s (and
not too much more). In particular, any time spent executing time(1)
itself is counted against the limit but not recorded in the output.
I think it makes more sense to reverse the order, so that the CPU time
limit is not applied to time(1) itself. This also resolves the test
failures I was seeing, which were reproducible only under load (i.e.,
running many tests in parallel).
MFC after: 2 weeks
Sponsored by: Klara, Inc.
(cherry picked from commit 0f63c4af5e4761680550b0aa08cc96f52076c08c)
This uses DES and it's likely that nobody uses that in 2025.
If somebody uses this we help them by deprecating and removing this.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D30682
(cherry picked from commit 723425f837270dd3b22098168ae9464a1ebe38c6)
findsym() is intended for use while parsing input, so it should not be
called from addsym2() or indirectsym(), which are called before any
input is processed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48733
(cherry picked from commit c63af363c2458aebc30c01cd0b93b4b902580019)
install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.
If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.
Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.
PR: 284119
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48504
(cherry picked from commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f)
vtfontcvt requires that all glyphs are 1x or 2x a common width,
reporting for example "bitmap with unsupported DWIDTH 27 0 on line xxx"
if the font is expected to be 32 pixels wide.
Add the expected / permitted values to the error message to make the
issue more clear - for the same example,
"bitmap with unsupported DWIDTH 27 0 (not 32 or 64)".
Reviewed by: ziaee
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 3433daae0d20d55503084c4d17b8a3e685657ad2)
People are often stunned by robust manual search functionality on
the community discord, so improve introductory doc regarding search by:
+ explain what search related flags do instead of using similies
+ consolidate and standardize search options in synopsis and usage
+ mention that a page or file can be specified in synopsis and example
+ call regular expressions `expression`, which searches to re_format(7)
+ crossreference the regular expression manual instead of egrep(1)
+ improve MANPATH xref flow and explanation, matching MAILPATH in sh(1)
+ mark up aditional semantics for their inclusion in apropos
While here:
+ use consistent spacing and form (Ql) for quoted literals
+ clean a few linter errors regarding self xref and nospace
+ reset a list width to indent for consistency with style.mdoc
+ tidy examples + align files + tag spdx
Outstanding:
- example 3 shows no results on a typical bsdinstall'd system
MFC after: 3 days
Reviewed by: elliejs, emaste, imp, Jessica Hawkwell, jlduran
Approved by: imp
(cherry picked from commit 46a9fb7287f41eedf321d81a68a826f231d11bfe)