In fd186cd16e I read the condition backwards. We want to stat all the
time until we can implement something to do it more inteligently as
Jiles suggested in the review.
Fixes: fd186cd16e
Noticed by: des
Sponsored by: Netflix
Move LLVM ar, nm, and size. Also move elftoolchain strings, which
should have already been there.
The remaining LLVM utilities (including strings) stay in -clang for now
since they're links to other executables.
Reviewed by: des, dim
Differential Revision: https://reviews.freebsd.org/D51583
bmake along with /usr/share/mk seems to meet the criteria for being in
its own package: it's self-contained and the majority of users (who are
using binary packages) don't need to install it, so it doesn't belong in
FreeBSD-utilities. Instead, put it in its own package.
Add a dependency on the new package from:
- sendmail (uses make to build its configuration)
- NIS (uses make to build the database).
But not from examples, because while some of the examples do require
make, they are intended as examples rather than something to be used
directly.
Reviewed by: manu, sjg
Differential Revision: https://reviews.freebsd.org/D50149
${.ALLSRC} can include the dependency OptParser.td, which causes
llvm-tblgen to fail since it only accepts a single input argument.
Use ${TDFILE} directly instead, which matches the other invocations
of tblgen in the LLVM Makefiles.
Fixes: d3c06bed2c ("clang: install clang-scan-deps")
MFC after: 3 days
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D51569
Also add license and copyright statement, with permission from the
original author.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D51537
Since it's not possible to pass more than {ARG_MAX} bytes on the command
line, it's also not possible to pass more than {ARG_MAX} individual
arguments. Therefore, {ARG_MAX} is a reasonable upper bound for the -n
option. This resolves both the arithmetic overflow issue and the CI OOM
issue, so we can safely re-enable the test.
Fixes: eab91d0081
Fixes: 2682a15527
MFC after: 1 week
Reviewed by: jlduran, emaste
Differential Revision: https://reviews.freebsd.org/D51536
Implement -fprint fn which will print the matching files to fn, each
followed by a newline ('\n'). And -fprint0 (same, except followed by a
NUL). Both of these are always true. The file is created if it does not
exist, or truncated if it does. This is done first thing
unconditionally, so if there's no output, the file will have zero
length.
Note: GNU Find appears to collect the output for -fprint* to the same
file such that they don't interfere. That detail is unimplemented at
present.
Sponsored by: Netflix
Discussed with: jilles
Reviewed by: pauamma@gundo.com (man)
Differential Revision: https://reviews.freebsd.org/D42667
Implements most of gnu find's -printf predicate. However, the '#', '-',
'.' and size format modifiers are unimplemented, as are %P, %H, %F, %y,
and %Y formats. Follows what I think it should do based on the info
page, I've not looked at the gnu find code.
Sponsored by: Netflix
Discussed with: des, jilles
Reviewed by: pauamma@gundo.com (man)
Differential Revision: https://reviews.freebsd.org/D38138
The default delay between screen updates was incorrectly transfered
from roff(7) register that was used in previous version of man page.
Reviewed by: ziaee
Fixes: 9d6cce02a7 (initial pass to freebsdize)
Differential Revision: https://reviews.freebsd.org/D51503
Add obiwac@ (myself) as new src committer with mckusick@ and jrm@ as
mentors.
Reviewed by: mckusick (mentor), jrm (mentor)
Approved by: mckusick (mentor), jrm (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51428
Most libxo-enabled utilities link to xo_parse_args.3. But that man page
doesn't actually describe how to format command-line arguments. Rather,
xo_options.7 does. I suspect that these utilities link to the former
because the latter man page did not exist until libxo-0.7.2
(8a6eceff3c). And newer utilities have probably been copy/pasting the
same text from older ones. But the superior man page does exist now,
so we should link to it instead.
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51354
The -w flag was previously removed when automatic column sizing was
introduced. Originally, -w enabled wider output, but used hardcoded
column widths that did not guarantee alignment with actual content.
This commit reintroduces the -w flag with a new purpose: to dynamically
size columns based on the longest entry in the current output. Unlike
the original behavior, this version ensures fully aligned and
consistently formatted rows.
By default, sockstat now uses fixed-width columns for more compact
output, especially in 80-column terminals. Users who prefer a full-width
view can now use -w to enable automatic column sizing.
Sponsored by: Google, LLC (GSoC 2025)
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1746
Reviewed by: asomers, glebius
Examples were previously overflowing at MANWIDTH 80. Keep the same
complexity but use shorter phrases to make them easier to read. Tag
SPDX while here.
MFC after: 3 days
Reviewed by: bcr
Discussed with: emaste
Differential Revision: https://reviews.freebsd.org/D50867
Stop adding contrib/sqlite3 into the include path for usr.bin/kyua, take
headers from the install sysroot env. sqilte3 now has the VERSION file,
which clashes with c++ include <version>.
Submitted by: jrtc27 (see https://reviews.freebsd.org/D51217)
Tested by: kib
Fixes: 17f0f75308 ("sqlite3: Vendor import of sqlite3 3.50.2")
We have had deprecation notice in the manpage for nearly six months, and
it is also present both in 13.5 and 14.3. tar(1) can supply this
functionality for those that truly need it, and cy@ has also created a
sysutils/freebsd-shar port for this version of a frontend to live on in
ports -- this port has been available since December 18, 2024.
Reviewed by: allanjude, cy, emaste, jrm
Differential Revision: https://reviews.freebsd.org/D50925
Switch various flags from int -> bool.
kill(getpid(), foo) and raise(foo) are equivalent in this context, so
switch to the latter as a minor preference for readability.
Use proper signal fences instead of volatile for our SIGALRM handler.
Reviewed by: kib (earlier version), des
Differential Revision: https://reviews.freebsd.org/D51027
This is useful to avoid having the command running twice in the face of
the admin terminating the process. Notably, if the -p option is not in
use (or can't be used, e.g., because we can't open the file for writing)
then this provides a nice alternative where one simply needs to send a
SIGTERM to the lockf(1) process associated with the lock file to clean
it all up.
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D51025
A future change will add a -T flag to forward SIGTERM along to the
child before we cleanup and terminate ourselves. Using a SIGCHLD
handler to do that with SIGTERM blocked only while the child is actively
being collected will enable us to safely do so without having to worry
that our pid is potentially invalid.
Add a test that concisely checks that the child's error is properly
bubbled up to the caller.
Reviewed by: des, kib
Differential Revision: https://reviews.freebsd.org/D51024
If we're going to hold the lock, it can be useful to scribble down the
pid that we spawned off to quickly associate the lock back to the
process that's keeping it open.
Reviewed by: allanjude (previous version), des
Differential Revision: https://reviews.freebsd.org/D51014
+ describe better
+ switch examples to human readable sizes, with consistent spacing
+ `Downsize ... in 5 Megabytes` >> `Downsize ... by 5 Megabytes`
+ remove prompt from lone example with prompt for consistency
+ remove x permissions from kernel example
+ examples now fit on standard console without wrapping
While here:
+ fold a line to eliminate linter warning + tag spdx
+ add -nosplit to AUTHORS to eliminate a rendering glitch
MFC after: 3 days
Discussed with: asomers, jhb, maxim
Reviewed by: imp (previous version)
Closes: https://github.com/freebsd/freebsd-src/pull/1568
In commit 95ac5b0e27 ("mkimg: Add a reproducible mode"), I added a -R
flag to mkimg, indicating that output should be reproducible.
There is one place in the VHD image backend that uses time(3) to
populate an image metadata field; this field is visible to tools which
know how to process VHD images. Rather than picking an arbitrary value
for that timestamp, it seems better to behave like makefs(8) and let the
invoker pick a suitable timestamp.
So, remove -R and instead add a -t option which lets the timestamp be
specified directly. Then, modify the VHD backend to use that timestamp.
Fixes: 95ac5b0e27 ("mkimg: Add a reproducible mode")
Reviewed by: bnovkov
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51077
clang-scan-deps is used to generate dependency information from C++20
modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is
required by common build tools (e.g., CMake) to build C++ sources
that use modules.
Since this is a core build tool, install it by default, not gated
behind MK_CLANG_EXTRAS.
[0] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html
MFC after: 3 days
Reviewed by: kevans, dim
Approved by: kevans (mentor)
Requested by: jbo
Differential Revision: https://reviews.freebsd.org/D51044
Revert a change to the cap_getnameinfo, accidentally introduced in
0726c6574f, that caused cap_getnameinfo to populate a buffer which was
about to be thrown away.
Fixes: 0726c6574f
Sponsored by: ConnectWise
Reviewed by: Damin Rido <rido@FreeBSD.org>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1753
Refactor sockstat to dynamically size table columns based on content.
This eliminates the need for the -w option, which is now ignored
for backwards compatibility.
Numeric columns are now right-aligned for improved readability;
previously, they were left-aligned.
Unknown fields are now consistently shown as "??" instead of a mix
of "", "?", and "?" for output uniformity.
Sponsored by: Google, LLC (GSoC 2025)
MFC after: 2 weeks
Reviewed by: asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/1720
mkimg embeds a UUID in the GPT header and uses the current time of day
to generate it, so its output is not reproducible by default. Add a -R
flag to ask it to use a fixed time for UUID generation.
Merge the FreeBSD-specific implementation of osdep_uuidgen() with that
of Linux, as the use of uuidgen(2) is incompatible with reproducible
output mode.
Reviewed by: bnovkov
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D49716
This seems to fit the pattern better (e.g. fdopendir()).
I've added weak references to ease the transition, but since it's only
been a few days, we can remove them (and the ObsoleteFiles entries for
the manual pages) before we branch stable/15.
Fixes: deeebfdeca
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D50980
The intent here is to characterize wide characters which fit in a single
byte. When wchar_t is signed, this comparison is insufficient.
On systems with signed wchar_t, of the files in /usr/share/locale this
only affects zh_CN.GB18030/LC_COLLATE.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50757
In several modules we build up an RB tree keyed by wide characters.
wchar_t has different signedness on different platforms, so iteration
over such a tree results in platform-dependent ordering.
The ctype module uses this ordering when writing the output file, which
creates reproducibility problems when comparing the results of cross
builds and native builds (e.g., native amd64 vs. cross-building on
arm64).
Modify such comparisons to always be unsigned. Introduce a helper
function for this purpose. In the other modules I believe the sort
order does not affect program output.
On systems with signed wchar_t, of the files in /usr/share/locale this
only affects zh_CN.GB18030/LC_CTYPE.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50756