Commit Graph

15533 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
09aee57098 tsort: Add unit tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40043
2023-05-10 15:45:44 +02:00
Dag-Erling Smørgrav
b55bc49e86 tsort: Replace bcopy() with memcpy().
Also fix an indentation error I introduced in the previous commit.

Fixes:		cb46f47c79
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40042
2023-05-10 15:45:38 +02:00
Dag-Erling Smørgrav
cb46f47c79 tsort: Error out if writing to stdout failed.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D39959
2023-05-04 18:51:11 +00:00
Dag-Erling Smørgrav
5903d9c00b ncal: Error out if writing to stdout failed.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D39958
2023-05-04 18:51:10 +00:00
Xin LI
d713e0891f MFV: less v632.
MFC after:	2 weeks
2023-05-01 20:43:57 -07:00
Simon J. Gerraty
090e9752d7 Additions to targets/pseudo/host-tools
More tools needed to be built for Linux.
These are the ones that "just work".
2023-04-27 14:16:49 -07:00
Eugene Grosbein
83fd35b3f3 logger(1): fix timestamps in case of long run
An example:

( echo test; sleep 2; echo test2 ) | logger -h /var/run/log

Before fix, logger assigned same timestamp to both records.

Fixes:		65547fb33d
Reported by:	Vadim Goncharov
MFC after:	1 week
2023-04-27 23:43:16 +07:00
Yuri Pankov
01007472ea getconf(1): add DEALLOC_PRESENT
Allow getconf to query _PC_DEALLOC_PRESENT pathconf(2) variable
added in 0dc332bff2.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39796
2023-04-26 13:13:36 +02:00
Simon J. Gerraty
cb3c414f2f bmake does not need libegacy 2023-04-24 16:55:45 -07:00
Simon J. Gerraty
8c973ee23d Merge bmake-20230414
Merge commit '51d8a8b4ac1dd7265e891149e470a803906de2a7'
2023-04-24 16:50:16 -07:00
Simon J. Gerraty
976ba7f02a Enable building tar for non-FreeBSD host
For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Add readpassphrase to libegacy to avoid the need for libbsd on Linux

src.opts.mk disable TESTS for host if MK_host_egacy is yes

Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39766
2023-04-24 10:20:17 -07:00
John Baldwin
4640fd28a1 netstat: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39731
2023-04-24 08:53:50 -07:00
Konstantin Belousov
043e24bdb0 posixshmcontrol(1): silently ignore inaccessible segments when listing
PR:	271038
Reported by:	rau8344@gmail.com
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-04-24 02:38:48 +03:00
Simon J. Gerraty
188bf8876f Build host tools on non-FreeBSD host with DIRDEPS_BUILD
Add Makefile.depend.options to libnetbsd, mkimg and makefs
to ensure libegacy is build if needed.

targets/pseudo/stage/Makefile avoid the need for mtree
the staging process creates target dirs as needed anyway.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39757
2023-04-22 13:13:22 -07:00
Cameron Katri
81fa5c4a82 llvm-strings: Install as strings when WITH_LLVM_BINUTILS=YES
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D32065
2023-04-21 16:13:40 -04:00
Ed Maste
41df1d60e3 llvm: fix some llvm-* tool links when WITH_LLVM_BINUTILS is set
A few Makefiles overrode LINKS and MLINKS when WITH_LLVM_BINUTILS was
set, which caused some llvm- prefixed tools to disappear.  One such case
was llvm-ranlib, which some ports invoke explicitly.

Use += when adding to LINKS and MLINKS under WITH_LLVM_BINUTILS.

PR:		270955, 270956, 270959
Submitted by:	jbeich
Reviewed by:	arichardson
Fixes: 021385aba5 ("Add WITH_LLVM_BINUTILS to install LLVM binuti...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39747
2023-04-21 12:49:05 -04:00
Warner Losh
e63690e885 truss: Kill dead code
If it doesn't exist, we don't need it in the table...

Sponsored by:		Netflix
2023-04-21 10:24:26 -06:00
Michael Tuexen
ddf24a507c netstat: cleanup
protopr does not support reading from a core anymore.
So don't state that it can.

Reviewed by:		glebius, rscheff, rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D39688
2023-04-20 23:52:19 +02:00
Gleb Smirnoff
8e813d07c6 netstat: fix printing of TCP pcbs with -A
This change touches both kernel and netstat(1), but either of the changes
will fix printing pcb addresses with -A.

The thing is that historically netstat(1) treated TCP differently, and
printed tcpcb address instead of inpcb address.  This is not documented
anywhere!  With e68b379244 these two addresses became the same.  It is
highly likely they will be the same for a long time, but it might be they
will start to differ again in a far future.  My proposal is to stop
treating TCP differently with netstat(1) and right now is a good opportunity
to do that, since there will be no behavior change at all.  The kernel
change to tcp_inptoxtp() will go into stable/14 to make it compatible with
netstat(1) binary from stable/13.  We can drop it later, probably together
with in_ppcb pointer from inpcb.  The in_ppcb in xinpcb will stay for size
compatibility.

Reviewed by:		tuexen, rrs
Differential Revision:	https://reviews.freebsd.org/D39736
2023-04-20 12:42:42 -07:00
Simon J. Gerraty
8fe4f8f7a7 Fix building host tools for host
Several makefile depend on tools built for host.
At least when using DIRDEPS_BUILD we can build these for the
pseudo machine "host" to facilitate building on older host versions.

Ideally we would build these tools in their own directories to avoid
building more than needed.

For now, setting an appropriate default for BTOOLSPATH will suffice

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39708
2023-04-20 10:05:43 -07:00
Michael Tuexen
373b95976b netstat: document that PCB information can't be read from corefiles
Reviewed by:		glebius, cc
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D39610
2023-04-19 12:15:35 +02:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
John Baldwin
d28a95513e mail: Use a C89 function pointer type for command functions.
The command function is defined to always take a void *.  Functions
which accept a pointer to an array of pointers use a local temporary
'argv' assigned from the void *arg.

Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D39527
2023-04-18 11:27:29 -07:00
John Baldwin
c330a185b7 locate: Use C89 function definitions.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39526
2023-04-18 11:27:08 -07:00
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