| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Prefer explicit NULL comparisons to using pointers as booleans
* Prefer explicit 0 comparisons to using strcmp() as a predicate
* Avoid use of strcpy()
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51876
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
parse_ports has been broken ever since 7b35b4d, and it's a sufficiently
complicated function that it really deserves some unit tests. Fix it,
and add tests. Refactor the code a little bit to facilitate unit tests.
Chiefly, split the tested functions out of main.c into sockstat.c .
PR: 288731
Fixes: 7b35b4d ("sockstat: add libxo support")
Sponsored by: ConnectWise
PR: https://github.com/freebsd/freebsd-src/pull/1807
Reviewed by: rido
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In preparation for splitting the file up. This commit is a clean
rename, so git's rename detection will work.
Sponsored by: ConnectWise
PR: https://github.com/freebsd/freebsd-src/pull/1807
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixed missing field names in xo_emit() calls for xolint compliance, treated
XO_STYLE_HTML like XO_STYLE_TEXT to apply space-padded formatting for
human-readable output, and updated usage() to indicate that --libxo accepts
arguments.
Reported by: Phil Shafer <phil@juniper.net>
Sponsored by: Google, LLC (GSoC 2025)
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1806
Reviewed by: asomers
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: markj, asomers (both earlier version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1498
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Switch up comparator mapping to avoid these kinds of errors, use a
simple array of (name, comparator) pairs rather than having to maintain
entries in two separate arrays that must have matching indices.
Reviewed by: obiwac
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37083
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Revert a change that mistakenly used SCTP path state and the field name
`path-state` instead of the correct `conn-state` and `sctp_conn_state()`
call. This was introduced in 7b35b4d during the addition of libxo
support.
Fixes: 7b35b4d ("sockstat: add libxo support")
Reported by: Phil Shafer <phil@juniper.net>
Sponsored by: Google, LLC (GSoC 2025)
Pull Request: https://github.com/freebsd/freebsd-src/pull
Reviewed by: asomers
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
grep|tee of the src/ tree for infrequently-occurring strings is fairly
annoying; drop some tactical flushes at line-match boundaries to reduce
the long stalls. In the case of `grep -o`, we'll flush after multiple
lines if there are multiple matches within a single line of text, while
for non`-o` we'll flush generally after every line.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The function used to create a backup of the input before starting work
used a static buffer and did not check that the file name it constructed
did not overflow. Switch to using asprintf(), clean up the rest of the
function, and update some comments that still referred to an earlier
version of the code.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D51796
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Much of the test script was concerned with working around RCS tags and
dealing with cases which don't apply to indent.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51795
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Each -printf invocation created a memstream, then freed the underlying
buffer without closing the stream, resulting in a segfault on exit
when libc tried to flush all the streams. Drop the memstream, which
isn't really needed.
Furthermore:
* Change escape() to return char * instead of const char *
* Simplify the implementation of %h
* Fix %M, which printed an extra space
* Implement %l correctly
* Implement %Y and %y
* Add tests for everything except %S
Fixes: 7b9c912c41f4
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D51776
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Switching from strtoll() to expand_number() was improper at the time as
it only accepted positive numbers. Now that it also accepts negative
numbers, the -b option is still broken because the same commit that
switched to expand_number() also dropped the multiplication by units.
Fixes: 643ac419fafb
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D51757
|
| |\| |
| | |
| | |
| | |
| | |
| | | |
Fixes bug in meta mode output capture.
Merge commit '787302bde4d89279180303b753eb73b9bc6820b9'
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The manpage claims that we display the credentials for the calling
process if no user/flags are specified, but this has not been true since
r145628 / 68b9b81e792a9108d. Currently, we display:
- uid from the calling process
- gid from /etc/passwd
- egid from the calling process, if different from that gid
- supplementary groups from the calling process
This doesn't really match the description in the manpage, and it doesn't
match other implementations. Fix it to use the current process
credentials for the gid as well.
Drop the extra arguments to id_print(), since these facts can be derived
from whether we're displaying live data (`pw == NULL`) or not.
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D51689
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Sponsored by: Google, LLC (GSoC 2025)
MFC after: 2 weeks
Reviewed by: asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/1770
Relnotes: yes
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In fd186cd16eaf 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: fd186cd16eaf
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: d3c06bed2c16 ("clang: install clang-scan-deps")
MFC after: 3 days
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D51569
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Pom uses localtime() so needs tzdata available.
PR: 278574
Reported by: Tatsuki Makino
Reviewed by: ivy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51521
|
| | | |
| | |
| | |
| | | |
Fixes: a52d0d76fa3e
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Accidentlaly committed with XXX write this. So write which formats
-printf supports.
Sponsored by: Netflix
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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: eab91d008165
Fixes: 2682a1552724
MFC after: 1 week
Reviewed by: jlduran, emaste
Differential Revision: https://reviews.freebsd.org/D51536
|
| | | |
| | |
| | |
| | |
| | | |
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D51530
|
| | | |
| | |
| | |
| | | |
Sponsored by: Netflix
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Minor fixes I missed in a review comment until after the commit.
Pointy-hat-to: imp
Fixes: 7b9c912c41f4
Sponsored by: Netflix
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | | |
Source: Wikipedia
<https://en.wikipedia.org/wiki/Practical_Astronomy_with_Your_Calculator>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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: 9d6cce02a78c (initial pass to freebsdize)
Differential Revision: https://reviews.freebsd.org/D51503
|
| | | |
| | |
| | |
| | | |
Sponsored by: The FreeBSD Foundation
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
limit the number of .so includes to a value of 32 instead of infinity.
PR: 287037
Differential Revision: https://reviews.freebsd.org/D51412
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\| |
| | |
| | |
| | | |
Merge commit '3d772e596c1acf76f555c1f51fd8d834e56b0c35'
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
(8a6eceff3ce). 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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
MFC after: 3 days
Fixes: 32efd26355e2 (Add a THR column)
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D50754
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | |
| | | |
PR: 286292
MFC after: 3 days
Reviewed by: ziaee
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
No functional change, but commit for correctness nonetheless.
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D51293
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
While here, wrap to 80 characters.
Approved by: ziaee
Differential Revision: https://reviews.freebsd.org/D51280
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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: 17f0f75308f2 ("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
|
| | | |
| | |
| | |
| | |
| | | |
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D51026
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|