Commit graph

16091 commits

Author SHA1 Message Date
Simon J. Gerraty
d9a65c5de1 Merge bmake-20250308 2025-03-19 14:10:44 -07:00
Chuck Silvers
623be660fc beep: add missing include of src.opts.mk, use LIBADD instead of LDFLAGS
Sponsored by:	Netflix
2025-03-19 12:48:10 -07:00
Konstantin Belousov
9491ae6f0d procstat.1: correct description of the kstack subcommand after removal of swapping
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
d76a31ca74 procstat.1: document kqueues
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
8289705834 procstat.1: document rlimitusage
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
0832381247 procstat.1: sort subcommands
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
28f4cf9217 procstat(1): dump kqueues
Example output from the 'procstat -a kqueues':
    PID       KQFD   FILTER      IDENT      FLAGS     FFLAGS       DATA      UDATA     STATUS
   2323         13     READ          5          -          -          0 0x19c290616000          -
   2323         13     READ          8          -          -          0 0x19c29064f070          -
   2323         13     READ         10          -          -          0 0x19c29064f0e0          -
   2323         13   SIGNAL          1          C          -          0        0x0          -
   2323         13   SIGNAL          2          C          -          0        0x0          -
   2323         13   SIGNAL          3          C          -          0        0x0          -
   2323         13   SIGNAL         13          C          -          0        0x0          -
   2323         13   SIGNAL         14          C          -          0        0x0          -
   2323         13   SIGNAL         15          C          -          0        0x0          -
   2323         13   SIGNAL         20          C          -          0        0x0          -

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Maxim Konovalov
5460bdda9d truncate.1: improve the example section
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
2025-03-07 01:45:21 +00:00
Dag-Erling Smørgrav
180065eb09 top: Make locale issues non-fatal.
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
2025-03-06 14:59:23 +01:00
Cy Schubert
f0c8d2cd62 shar: Make sure a sed failure in the generated archive results in failure
Obtained from:	NetBSD hg commit 365369:21b92f0055b4
MFC after:	1 week
2025-02-18 09:16:48 -08:00
Cy Schubert
1080f53154 shar: Handle special characters or white space in file names fed to shar
Obtained from:	NetBSD hg commit 365370:124268924386
MFC after:	1 week
2025-02-18 09:16:48 -08:00
Mark Johnston
0f63c4af5e limits tests: Try to fix spurious cputime test failures
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.
2025-02-14 16:26:19 +00:00
Gleb Smirnoff
9f55128fec sockstat: with -A print pcb addresses, just like netstat(1) 2025-02-11 10:23:15 -08:00
Gleb Smirnoff
01a46c7dc0 sockstat: use bool for flags
No functional change.
2025-02-11 10:23:15 -08:00
Minsoo Choo
ca4eddea97 src: Use gnu17 as the default C standard for userland instead of gnu99
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
2025-02-11 09:16:25 -05:00
Craig Leres
1070477cc8 Fix remaining zgrep(1) wrapper script regressions
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
2025-02-09 10:45:03 -08:00
Gleb Smirnoff
d2e6eb6046 genl: fix printing of a command with zero capabilities 2025-02-04 11:52:35 -08:00
Ed Maste
c032fb8557 netstat: Use bool more widely
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
2025-02-04 14:12:21 -05:00
Alexander Ziaee
4a5d51e73e
resizewin.1: Fix option list width typo + spdx
MFC after:		3 days
Accepted by:		mhorne (mentor)
Differential Revision:	https://reviews.freebsd.org/D48349
2025-02-03 15:24:41 -05:00
Gleb Smirnoff
c2aa91745e netstat: restore printing the "default" keyword, provide -nn option
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
2025-02-03 10:09:58 -08:00
Gleb Smirnoff
fe5a6266dd protosw: this is a kernel only header, put back #ifdef _KERNEL
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.
2025-02-03 09:48:53 -08:00
Gleb Smirnoff
bf3338e74b netstat: cleanup includes in mroute6.c
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.
2025-02-03 09:48:41 -08:00
Gleb Smirnoff
88cd1e17a7 genl: add RPC parser that dumps what sys/rpc/clnt_nl.c sends
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
2025-02-01 01:00:25 -08:00
Simon J. Gerraty
a69ac6ee79 Fix mangled bmake makefile 2025-01-30 17:02:45 -08:00
Simon J. Gerraty
6a7405f5a6 Merge bmake-20250125
Merge commit '5ad769f660f3d00853bc739f82d9bc62f6a682cb'
2025-01-30 15:51:52 -08:00
Dag-Erling Smørgrav
4a1b0a9e2b unifdef: Restore damaged test case.
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
2025-01-30 22:38:07 +01:00
Dag-Erling Smørgrav
c63af363c2 unifdef: Fix collision check when adding symbols.
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
2025-01-30 22:10:46 +01:00
Alexander Ziaee
2f893597fc
seq.1: Reset option list alignment + tag spdx
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
2025-01-27 14:43:28 -05:00
Alexander Ziaee
46a9fb7287
man.1: Improve search + spdx
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
2025-01-24 19:07:01 -05:00
John Baldwin
dd3603749c iscsi: Move valid_iscsi_name to libiscsiutil
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
2025-01-24 09:53:22 -05:00
Alexander Ziaee
b937aac622
ziaee@ joins comitters-doc and calendar.freebsd
Approved by:		carlavilla, mhorne (mentors)
Differential Revision:	https://reviews.freebsd.org/D48647
2025-01-23 17:52:59 -05:00
Emmanuel Vadot
9dcb984251 Remove publickey(5) stuff
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
2025-01-22 18:04:26 +01:00
Emmanuel Vadot
723425f837 Deprecate publickey(5) stuff
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
2025-01-22 18:03:45 +01:00
Ed Maste
4b04f5d7e8 install: Fix METALOG ouptut for numeric -o and -g args
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
2025-01-21 07:47:48 -05:00
Ed Maste
3433daae0d vtfontcvt: Improve error message for unsupported DWIDTH
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
2025-01-20 15:23:49 -05:00
Cy Schubert
13d81ef632 genl.1: Improve grammar
Make the first sentence read more smoothly.

MFC after:	3 days
2025-01-16 20:18:24 -08:00
Gleb Smirnoff
40462a376a genl: stop using struct _getfamily_attrs, snl_genl_ctrl_mcast_group
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
2025-01-16 18:24:32 -08:00
Baptiste Daroussin
491db92a17 bintrans(1): fix typo
Reported by:	Helge Oldach <freebsd@oldach.net>
2025-01-16 16:48:10 +01:00
Brooks Davis
660331da7a Centralize and simpify implemention of some VM macros
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
2025-01-14 10:48:07 -05:00
Maxim Konovalov
0340a8c969 genl: formatting fix 2025-01-13 00:46:29 +00:00
Maxim Konovalov
8b5058ec78 genl: typo fixes
PR:	284017
2025-01-13 00:42:55 +00:00
Baptiste Daroussin
beab8b1ddf bintrans(1): RFC2047 variant of quoted print
MFC After:	1 week
Reviewed by:	pstref
Differential Revision:	https://reviews.freebsd.org/D48381
2025-01-09 10:27:18 +01:00
Baptiste Daroussin
a8d9bd3fa5 bintrans(1): qp switch to getopt_long
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
2025-01-09 10:24:34 +01:00
Mark Johnston
596ee234ef ktrace: Make -t t trace struct arrays as well as structs
Otherwise there is no specific -t option which captures struct arrays.

MFC after:	1 week
2025-01-07 14:32:20 +00:00
Baptiste Daroussin
4087ffdbce nvi: import version 2.2.1-52c07e8 2025-01-02 10:04:12 +01:00
Kyle Evans
2832af7b4e shar: add a note about the port to the deprecation warning
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
2025-01-01 21:18:00 -06:00
Kyle Evans
f68ee0e7a1 shar: add a deprecation notice
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
2025-01-01 20:15:36 -06:00
Mark Johnston
003818aca4 sed tests: Add a regression test for the c function
Based on the test case from PR 271817 by Mohamed Akram.

PR:		271817
MFC after:	2 weeks
2024-12-23 19:08:15 +00:00
Mohamed Akram
5982237f1e sed: Fix handling of an empty pattern space
Add a regression test.

PR:		271791
Obtained from:	OpenBSD (1.38 millert)
MFC after:	2 weeks
2024-12-23 19:07:14 +00:00
Dag-Erling Smørgrav
893839b119 diff: Fix device case.
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
2024-12-23 18:16:14 +01:00