Commit Graph

15509 Commits

Author SHA1 Message Date
John Baldwin
1bd44215d0 less: Silence -Wdeprecated-non-prototype warnings.
This has an active upstream so will presumably be fixed upstream at
some point.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39525
2023-04-18 11:26:08 -07:00
John Baldwin
525438ea71 sendmail: Silence -Wdeprecated-non-prototype warnings.
These will hopefully be fixed upstream eventually, but silence the
warnings until then.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39518
2023-04-18 11:19:48 -07:00
Dag-Erling Smørgrav
1bc6dcc287 renice: Factor out common code in tests.
Furthermore, prefer test -eq (which ignores whitespace) over a strict string equality test when comparing numerical values.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D39650
2023-04-18 17:14:25 +00:00
Mateusz Piotrowski
fb49925999 split: Update synopsis and usage; fix examples
- Mark -d as an optional flag
- Add a prompt to one of the examples for consistency
- Add -d to the usage message

Sponsored by:	Klara Inc.
2023-04-18 15:30:00 +02:00
Dag-Erling Smørgrav
d59dd30cf1 renice: Clean up the tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D39629
2023-04-18 05:31:56 +00:00
Gordon Bergling
1190b82c22 last(1): Remove double words in source code comments
- s/on on/on/
- s/we we/we/

MFC after:	5 days
2023-04-18 07:14:53 +02:00
Yuri Pankov
21ef48af5c xargs: improve foundeof check for -E
4aeb63826e got it almost correct (we can't use strcmp() here as
current argument isn't guaranteed to be NUL-terminated), but we also
need to check that current argument length is equal to that of eofstr.

PR:		270867
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D39583
2023-04-17 22:20:03 +02:00
Dag-Erling Smørgrav
b03311cadd renice: Avoid segfault if -n flag is given without argument.
Fixes:		65ee0a8495
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D39623
2023-04-17 19:50:19 +00:00
Gordon Bergling
82a036d86a morse.6: Mention to standards in the SEE ALSO section
Mention ITU-T Recommendation F.1 and ITU-R M.1677-1
in the SEE ALSO section.

Obtained from:	OpenBSD
MFC after:	5 days
2023-04-16 11:46:09 +02:00
Gordon Bergling
991360ba49 grdc.6: Add an ENVIRONMENT section
- Add an ENVIRONMENT section

Obtained from:	OpenBSD
MFC after:	5 days
2023-04-16 11:17:06 +02:00
Eric van Gyzen
485f783f88 limits_test: validate CPU time used, not real time
RLIMIT_CPU applies to CPU time, not real (wall-clock) time.
This test failed in AWS, where the real time was 5-7 seconds.

Sum the user and system CPU time used, and validate that.

While I'm here, don't bother specifying -s exit:0 or -e empty,
since those are checked by default.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2023-04-14 16:16:05 -05:00
Ed Maste
c3dbcadca2 mail: fix build if TIOCSTI is not defined
Sponsored by:	The FreeBSD Foundation
2023-04-10 16:08:20 -04:00
Ed Maste
5cb402cc89 llvm-objcopy: link man page as strip.1 when WITH_LLVM_BINUTILS is set
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39429
2023-04-06 10:12:21 -04:00
John Baldwin
eeedaefab5 Remove LLVM build glue for MIPS as a native architecture.
This does not remove LLVM_TARGET_MIPS.  Note that the only
MACHINE_ARCH values ending in 'hf' were all MIPS architectures, hence
removing the pattern matches for 'hf'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39331
2023-03-29 15:06:15 -07:00
Dimitry Andric
4dc3b1fa1b Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"
This reverts commit ab80f0b21f. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes:		ab80f0b21f
2023-03-29 20:37:02 +02:00
Dimitry Andric
d8ed7fa3d5 Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"
This reverts commit 8f391d9098. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes:          8f391d9098
2023-03-29 20:31:33 +02:00
Dimitry Andric
8f391d9098 Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed
This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by:	des
MFC after:	1 week
2023-03-29 19:49:49 +02:00
Mark Johnston
ae2f0b2611 tftp tests: Fix a typo in the makefile
Fixes:	64c2a712d6 ("tftp: Add tests.")
2023-03-26 12:54:59 -04:00
Alexander V. Chernikov
64dfea8651 netlink: add NETLINK/NETLINK_SUPPORT userland options.
Make userland tools such as netstat, route, arp and ndp use
 either netlink or rtsock interfaces based on the NETLINK_SUPPORT
 options.
Both NETLINK and NETLINK_SUPPORT options are turned on by default.

Reviewed By: eugen
Differential Revision: https://reviews.freebsd.org/D39148
2023-03-26 08:59:58 +00:00
Ed Maste
ddf77ec392 etdump: exit on error if section header or entry offset is OOB
PR:		263663
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35868
2023-03-22 09:12:45 -04:00
Ed Maste
68a930d8ee lorder: add deprecation notice
lorder has not been used by the base system since 0e1e341b48 and
hasn't really been necessary for a very long time.

PR:		259254 [exp-run]
Reviewed by:	arichardson (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30080
2023-03-21 10:20:42 -04:00
Ed Maste
e9f8723c30 ldd: clarify format options
-f may be specified zero, one, or two times.  Make this clear in the
usage.

Reviewed by:	markj, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34733
2023-03-21 10:14:03 -04:00
Alexander V. Chernikov
9ee6278b78 netstat: fix double-free in netlink error code path.
CID:	1504382
2023-03-18 14:01:46 +00:00
Alexander V. Chernikov
aee2f11bf4 netstat: simplify netlink route printing code.
A number of improvements has commited to snl(3) recently.
A notable one is snl(3) build-in parsers for all of the objects
 exported by the kernel.

This change updates netlink handling code to the latest available snl(3)
API.
2023-03-18 13:05:41 +00:00
Mateusz Guzik
3451ed888e less: silence K&R warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-03-16 18:24:12 +00:00
Dag-Erling Smørgrav
fa3af3ce50 tail: Verify correct behavior when input does not end in a newline.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D39116
2023-03-16 15:37:02 +00:00
Dag-Erling Smørgrav
fc76ddee9b tftp: Add test cases for URL mode.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39014
2023-03-13 16:16:26 +00:00
David E. O'Brien
65e9eb0701 Look in getlocalbase() for the calendar-data package data
Fix d20d655018 where getlocalbase()
wasn't used to fill out the printf(3) format of _PATH_INCLUDE_LOCAL.

Differential Revision:	https://reviews.freebsd.org/D38975
Reviewed by:	imp
2023-03-12 18:40:07 -07:00
Dag-Erling Smørgrav
64c2a712d6 tftp: Add tests.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D38969
2023-03-10 13:25:16 +00:00
Dag-Erling Smørgrav
92570f67c7 tftp: Correctly propagate transfer errors.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38958
2023-03-10 13:25:16 +00:00
Brooks Davis
af0cc0b223 NgATM: Remove netgraph ATM support
Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by:	manu
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38879
2023-03-09 18:04:02 +00:00
Kyle Evans
b617584942 grep: remove tautological condition
st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID:		1008931
2023-03-08 23:53:10 -06:00
Kyle Evans
c816aea7ab Revert "grep: remove tautological condition"
This reverts commit f6d6c66889.

Gremlins snuck into my tree and injected some WIP.
2023-03-08 23:52:23 -06:00
Kyle Evans
f6d6c66889 grep: remove tautological condition
st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID:		1008931
2023-03-08 23:34:22 -06:00
Dag-Erling Smørgrav
473a2c9a40 byacc: Disable backtracking extension.
When updating byacc to 20230201, I enabled the backtracking extension as it seemed useful and harmless.  With a little more experience, it appears to have more impact than I initially thought and I'm no longer sure how useful it really is, so turn it back off.

PR:		244149, 269425
Sponsored by:	Klara, Inc.
Reviewed by:	imp, jkim
Differential Revision:	https://reviews.freebsd.org/D38931
2023-03-07 17:20:49 +00:00
Alexander V. Chernikov
6a6f2b0ce9 netstat: fix IPv6 link-locals & custom multipath printing. 2023-03-06 15:08:09 +00:00
Kajetan Staszkiewicz
cd9e5d4333 netstat: fix pfsync stats spelling
Reviewed by:	mjg
2023-03-05 22:50:07 +00:00
Ed Maste
1b00334852 bc: remove MIPS Makefile case
MIPS support has been removed from FreeBSD.

Sponsored by: The FreeBSD Foundation
2023-03-01 10:38:12 -05:00
Dimitry Andric
ab80f0b21f Ensure .inc files are regenerated when llvm/clang tblgen binaries change
When doing a fully incremental build (with WITHOUT_CLEAN enabled), from
a commit before llvm 15 was merged (3264f6b88f), to a commit after
that, a number of .inc files were not regenerated. This could lead to
unexpected compilation errors when these .inc files were included from
llvm-project sources, similar to:

  In file included from /usr/src/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:8268:
  /usr/obj/usr/src/amd64.amd64/lib/clang/libclang/clang/Basic/arm_mve_builtin_cg.inc:279:18: error: no matching constructor for initialization of 'clang::CodeGen::Address'
    Address Val2 = Address(Val1, CharUnits::fromQuantity(2));
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by making the .inc files dependent on the tblgen binary
used for generating them. E.g., we can relatively safely assume that if
the binary gets updated, the .inc files must also be updated. (Although
this is not 100% optimal, the gain by complicating things even more is
probaby not worth the effort.)

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D38770
2023-02-26 15:56:07 +01:00
Daniel Tameling
e052829e3e uniq(1): use strtonum to parse options
Previously strtol was used and the result was directly cast to an int
without checking for an overflow. Use strtonum instead since it is
safer and tells us what went wrong.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/643
2023-02-25 10:25:51 -07:00
Piotr Kubaj
6ae90f5985 gh-bc: don't disable LTO on powerpc64
Summary:
The LTO issue has been fixed. While -flto for some reason is commented out,
since it wasn't completely removed, it may be expected to be reenabled.

Reviewers: se
Approved by: se
MFC after: 3 days
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D38755
2023-02-25 00:49:27 +01:00
Stefan Eßer
77606d5a8c usr.bin/gh-bc: clean-up Makefile
Remove commented out debug options and re-enable LTO for most
architectures.
2023-02-25 00:07:25 +01:00
Thomas Munro
58e3631bd0 truss: Add preadv(2) and pwritev(2).
We already knew how to decode readv(2)/writev(2).  Add the versions with
an offset.

Reviewed by:            asomers
Differential Revision:  https://reviews.freebsd.org/D27531
MFC after:              2 weeks
2023-02-21 22:40:14 +13:00
Dag-Erling Smørgrav
8e022d3cde byacc: Update to 20230201.
Note that this enables the backtracking extension, which we had previously left disabled.

PR:		244149, 269425
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38421
2023-02-20 23:35:32 +01:00
Fernando Apesteguía
e6ffcf4ac7 zless(1): handle uncompressed files
In the manual page for zmore(1) and zless(1) it is said that zless(1) is
equivalent to zmore(1) except that it uses less(1) as a pager. However
zmore(1) is able to handle uncompressed files transparently while zless(1)
is not.

Add another case to the switch in lesspipe.sh to handle non-compressed files.

PR:		196437
Reported by:	marquis@roble.com
Approved by:	mjg@
Differential Revision: https://reviews.freebsd.org/D38674
2023-02-20 11:15:09 +01:00
Warner Losh
ef6f20ce47 tail: Retry kevent if the system call was interrupted
kevent returns EINTR when I suspend / resume. This causes tail -f
and tail -F to exit with interrupt system call. Ignore this error
and try kevent again.

Sponsored by:		Netflix
2023-02-18 20:09:26 -07:00
Fernando Apesteguía
91706f0d6d netstat.1: Clarify -i and -I priorities
netstat(1) allows to specify both -i (all interfaces) and -I <ifname>.
However, when both are specified, -I always overrides -i.
Add a comment where appropriate the same way we do in rm(1) for -f and -i.

PR:		202708
Reported by:	demon@
Approved by:	manpages (pauamma@)
Differential Revision: https://reviews.freebsd.org/D38654
2023-02-18 18:01:34 +01:00
Mateusz Guzik
2924ae099a Revert "cpuset: add --count"
The patch introduced a behavior change coming from getopt_long, namely
the entire argument array would be parsed looking for opts, which
affected uses spawning new processes without passing '--' to delimit
where cpuset arguments end. [1]

Apart from that turns out the change had a bug: using CPU_LEVEL_ROOT
instead of CPU_LEVEL_WHICH, returning a different cpuset than intended.
[2]

The intended functionality is provided with nproc(1), which landed after
this change.

As such, revert for the time being.

This reverts commit d9d5f2c042.

Reported by:	Mark Millard [1]
Reported by:	jbeich [2]
2023-02-16 18:18:49 +00:00
Dag-Erling Smørgrav
5016d112ad wc: Make the read buffer static.
The read buffer in cnt() is 64 kB, which is a bit excessive for a stack variable.  MAXBSIZE has grown since this code was originally written, and it might grow again in the future.  Since the program is single-threaded and cnt() does not recurse, we can safely make the buffer static.

While there, constify p since it is only used to read.

Sponsored by:	Klara, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38608
2023-02-16 00:40:45 +00:00
Dag-Erling Smørgrav
5c870e1b48 wc: Improve test coverage.
* Add a test that causes mbrtowc() to return 0.

* Add a test that causes mbrtowc() to return -2.

Sponsored by:	Klara, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38605
2023-02-16 00:40:45 +00:00