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
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
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.
Tracking newer versions of C (and C++) permits assuming newer language
features in the base system. Some C11 extensions are already used in
the base system but implemented on top of GNU C extensions such as
_Alignas and _Static_assert. In some cases the fallback versions in
cdefs.h are more limited than the native C11 extensions.
Even though C11 is the next major version of C, C17 is chosen instead
since C17 does not add new features to C but merely fixes defects in
C11. It is also well supported by a wide range of clang (7.0.0+) and
GCC (8.1+) versions.
Along with changing the default, this change also removes explicit
requests for c11 via the CSTD variable in various Makefiles.
Libraries and binaries for ZFS continue to use c99.
PR: 284039 (exp-run)
Reviewed by: imp, arichardson, emaste
Differential Revision: https://reviews.freebsd.org/D43237
Summary:
Fix short flags without whitespace, e.g:
zgrep -wefoo test
Fix multiple -e flags:
zgrep -e foo -e xxx test
Previously only the last pattern would be used.
Clean up possible leading blank in ${grep_args}.
Update comment: 2.51 -> 2.6.0
Add a test case for the last known zgrep wrapper issue: recursion
(-r) not implemented.
Reviewers: markj, kevans, ngie, bapt
Reviewed By: markj
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D48873
Following c2aa91745e ("netstat: restore printing the "default"
keyword, provide -nn option"), consistently use bool where appropriate
for commandline flags.
Reviewed by: glebius
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48832
Avoid POLA breakage and preserve output standard that really predates
the FreeBSD project itself. There are scripts in the wild that rely
on the behavior.
Provide option to specify -nn twice to have a completely numeric
output of the routing tables.
Fixes: 9206c79961
This reverts commit e090646d6f.
Reviewed by: zlei, gallatin, melifaro, allanjude, markj, emaste
Differential Revision: https://reviews.freebsd.org/D48729
The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3d) with no clear original reason. Since these old times two
abusers of the header leak were created - libprocstat(3) and netstat(1).
These two already have a lot of _WANT_FOO hacks, so satisfy them with
_WANT_PROTOSW.
While here, cleanup and sort forward declaraions.
The file obtains some kernel structures in a dirty way and needs
forward declaration of struct sockopt for that. Make it explicit
instead of getting it via headers that were not designed for that.
Use a separate file for the RPC parser. Potentially it may get bigger.
Also to avoid include RPC header pollution of the genl.c.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48551
The input for the hash_comment test case was damaged in a cleanup sweep.
Restore the original input and tweak it slightly so it no longer matches
the regex used in said sweep.
Sponsored by: Klara, Inc.
Fixes: 5e3934b15a
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
This option list was tabbed over 19 characters. style.mdoc(5) asks
that lists are set to the longest item, or if that's too long then
to use indent. Resetting it to indent buys us two lines at MANWIDTH
80, and three at 59.
MFC after: 3 days
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D48350
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
While here, use isxdigit(3) instead of a home-rolled version.
Reviewed by: mav, asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48593
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/D30683
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
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
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
This program has two modes: monitor a single family and dump known
families. The former uses directly snl_get_genl_family_info() which uses
supposedly internal struct _getfamily_attrs as the argument. The latter
uses a parser named genl_family_parser that makes a mixture of local
definitions and definitions from <netlink_snl_generic.h>. While the
struct genl_family_parser is local, it points at struct
snl_genl_ctrl_mcast_groups and struct snl_genl_ctrl_mcast_group that are
supposedly private to netlink_snl_generic.h, as are hanging off the
underscored _getfamily_attrs.
Rewrite this mess by using same parser for both modes, that is fully
implemented locally. This parser has another very important difference to
the one declared in the header library. It will copy strings out of the
message into memory allocated within the snl_state. With the header
library parser strings point into received packet and contents will be
overwritten on next netlink message. This is not a bug with existing
genl(1) program, but it would be with future changes.
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D48479
These macros have substantially identical implementations on each
platform. Use roundup2/rounddown2 for round_page/trunc_page.
This version standardizes on not using explicit casts and instead
preserving the original type. A couple of tweaks were required to
make this work.
Reviewed by: brooks, kib, markj
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D48450
In preparation for more arguments, switch bintrans qp argument parsing
to getopt_long, while here make the decodign argument being -d|--decode
for compatibility with base64 encoding/decoding
MFC After: 1 week
Reviewed by: pstef
Differential Revision: https://reviews.freebsd.org/D48380
cy@ was kind enough to preemptively create a port from the version of
this script in base for those that need this exact interface; add a
pointer to it so that interested individuals could start installing it
sooner rather than later.
Noted by: cy
MFC after: 3 days
The shar(1) program is simple, but the fundamental idea of a sh archive
is risky at best and one that we probably shouldn't be promoting as
prominently as a program in $PATH and a manpage. Let's deprecate and
remove it, since the same functionality can easily be found in
tar(1) instead.
Reviewed by: emaste, philip
Reviewed by: allanjude, brooks, delphij, des, imp, rpokala (previous)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D48130
We already fell back to Stone for FIFOs, but we actually need to fall
back to Stone for everything except regular files, because libdiff's
atomizer needs to know the size of its input in advance, and neither
FIFOs nor devices can be trusted to report their size.
MFC after: 1 week
Reported by: mav
Reviewed by: mav, allanjude
Differential Revision: https://reviews.freebsd.org/D48181