Commit Graph

15051 Commits

Author SHA1 Message Date
Konstantin Belousov
01c77a436e Pass vdso address to userspace
Reviewed by:	emaste
Discussed with:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D32960
2021-12-06 20:46:49 +02:00
Stefan Eßer
5e04571cf3 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2021-12-05 23:00:25 +01:00
Gordon Bergling
c8ca80e223 elf(3): Fix a typo in a sysctl description
- s/segement/segment/

MFC after:	3 days
2021-11-30 10:38:34 +01:00
Danilo G. Baio
ec80eab8a1 motd: Fix Questions List address
Following mailing lists migration from Mailman to Mlmmj.

https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
-->
https://lists.freebsd.org/subscription/freebsd-questions

Adding a short link (as we already have for Faq and Handbook), so all
links can be indented the same way.

Reviewed by:	imp (earlier version)
Approved by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D33101
2021-11-28 18:15:04 -03:00
Baptiste Daroussin
848ee2a3a8 bsddialog: actually add directories 2021-11-24 12:13:45 +01:00
Ed Maste
036af1053a mkimg: zero entry in vhdx_write_metadata
Otherwise _reserved might contain uninitialized data.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-11-20 19:37:25 -05:00
Mateusz Piotrowski
01e3140571 top.1: Use the Dq macros instead of \*lq and \*rq
MFC after:	3 days
2021-11-18 15:56:49 +01:00
Mateusz Piotrowski
c947fc5fae top.1: Improve description of -m
Describe -m argument as "mode" instead of "display".

MFC after:	3 days
2021-11-18 15:56:48 +01:00
Mateusz Piotrowski
82d0f865ee top: Sort flags in usage message
While here, fix the indentation of the second line in the message.

MFC after:	3 days
2021-11-18 15:56:47 +01:00
Mateusz Piotrowski
1125390415 top.1: Sort options alphabetically
While here, add a short sentence introducing the options.

MFC after:	3 days
2021-11-18 15:56:47 +01:00
Mateusz Piotrowski
b8135ed67c top.1: Fix a typo in description of H interactive command
B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes:		9d6cce02a7
MFC after:	3 days
2021-11-18 15:56:46 +01:00
Warner Losh
d677d4be0c Skip -flto for all MIPS ports
There likely should be a macro for the ports that support lto, but I'm
making sure that all the mips things build before decommissioning it and
this is the only thing that's broken...

Sponsored by:		Netflix
2021-11-16 16:23:02 -07:00
Konstantin Belousov
7d20a08076 ldd: also use exec mode for -a
The -a option also requires passing specific environment variables to
instance of rtld doing tracing.

PR:	259069
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-15 22:49:33 +02:00
Brooks Davis
8e4a3add99 struct kevent_freebsd11 -> struct freebsd11_kevent
Rename to match the naming of syscalls and allow 32 to be appended
without making an ugly name like kevent_freebsd1132.

While here, make the kevent changelist argument const.

Reviewed by:	kib
2021-11-15 18:34:27 +00:00
Baptiste Daroussin
6d38604fc5 mandoc: import version 1.14.6
MFC after: 3 weeks
2021-11-15 16:58:58 +01:00
Konstantin Belousov
0864ab3d32 procstat auxv: print out FXRNG
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-15 02:32:00 +02:00
Rick Macklem
75c666197c nfsstat: Add output for counts of new RPCs to the "-E" option
Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

MFC after:	2 weeks
2021-11-14 13:36:14 -08:00
Dimitry Andric
28a41182c0 Merge llvm-project 13.0.0 release
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-0-gd7b669b3a303, aka 13.0.0 release.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:49:29 +01:00
Dimitry Andric
fe6060f10f Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:39:49 +01:00
Felix Johnson
5504d83942 sockstat(1): Update Synopsis section
Update sockstat(1) manpage so the Synopsis section includes q (silent
mode) and the -j argument name is consistent.

PR:		256795
MFC after:	3 days
Reported by:	Nick Reilly <nreilly@blackberry.com>
2021-11-10 15:22:06 -05:00
Kyle Evans
4c14980baa grep: fix/remove references to -P
-P in gnugrepland means PCRE, which we do not support.  We may eventually
support it if onigmo ends up getting imported as a more performant regex
implementation, and we can re-add it properly in these places (and more)
when that time comes.

The optstr change is a functional nop; the case was not explicitly handled,
thus ending in usage() anyways.

Reported by:	Vladimir Misev (via twitter)
2021-11-10 00:42:42 -06:00
Mike Karels
a2e7dfca86 systat: clean up code assuming network classes
Similar to netstat, clean up code that uses inet_lnaof() to check for
binding to "host 0" (lowest host on network) as a "network" bind.
Such things don't happen, and current networks are seldom if ever
found in /etc/networks.

MFC after:	1 month
Reviewers:	tuexen
Differential Revision: https://reviews.freebsd.org/D32720
2021-11-09 09:35:16 -06:00
Mike Karels
64acb29b7d sockstat: change check for wildcard sockets to avoid historical classes
sockstat was checking whether a bound address was "host 0", the lowest
host on a network, using inet_lnaof().  This only works for class A/B/C.
However, it isn't useful to bind such an address unless it is really
the unspecified address INADDR_ANY.  Change the check to to use that.

MFC after:	1 month
Reviewd by:	tuexen
Differential Revision: https://reviews.freebsd.org/D32715
2021-11-09 09:34:44 -06:00
Mike Karels
bd27c71c45 netstat: reduce use of historical Internet classes
When attempting to characterize bound addresses, netstat was checking
for host 0 on a (historical) net using inet_lnaof().  Such addresses
are not normally bound, as they would not work, with the exception
of the unspecified address, INADDR_ANY.  Check for that explicitly.
Similarly, don't check bound addresses for a match to a network name.

MFC after:	1 month
Reviewed by:	tuexen
Differential Revision: https://reviews.freebsd.org/D32714
2021-11-09 09:34:22 -06:00
Dries Michiels
ecf58c066c Complete steps 5 and 9 for new committers (driesm)
Reviewed by: 0mp (mentor)
Approved by: 0mp (mentor)
Differential Revision: https://reviews.freebsd.org/D32890
2021-11-08 17:19:57 +01:00
Felix Johnson
52dbe1a0f4 find(1): Update date format reference and remove cvs(1) references
cvs(1) is not installed by default. Change the date format reference to
note that find(1) understands ISO8601 and RFC822 date formats. Also
remove references to cvs(1).

PR:		254894
MFC after:	3 days
Reported by:	danielsh@apache.org
2021-11-08 01:14:58 -05:00
Warner Losh
517e52b6c2 awk: Move to using two sets of tests
Upstream one-true-awk has two sets of tests. These are in addition to
NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are
ready to use as-is (more or less). However, the 'tests' from upstream
are not, so for now we'll just use the netbsd and bugs-fixed tests.
They provide an OK workout and are better than nothing, though the tests
themselves are for specific esoteric things.

The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test
for errors and the upstream test jig mashes stdout and stderr together,
which atf doesn't do, so make a tiny tweak to the upstream tests that I
hope to upstream. Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream and have changed the test locally.

In addition, the system-status.awk test is not suitable to run in ATF.
It wants to force sh to dump core, but kyua doesn't seem to allow that
sometimes so the test will fail or pass based on whether or not a core
dump can be created. Since it's unstable, remove it.

This required moving the netbsd tests to a new direcotry, so update
mtree files as well. The change is useless for 'make check' without it.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31376
2021-11-05 08:53:36 -06:00
Hans Petter Selasky
8abfbe5a79 beep(1): Initial version of utility to create terminal beep via soundcard.
Reviewed by:	imp@, emaste@ and pstef@
Differential Revision:	https://reviews.freebsd.org/D32672
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-11-04 09:00:46 +01:00
Mateusz Piotrowski
3693250e8a dpv.1: Do not use mdoc macros for Bl width
Macros do not expand there.

MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Piotrowski
f7c7a6ac00 dpv.1: Fix an example
dpv(1) requires a label to be specified.

MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Piotrowski
a85aa7f9d3 dpv: Fix synopsis formatting & sort options
MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Guzik
932c2667d9 systat: fix stack overflow when running -iostat
The new buffer is arbitrarily sized to likely "big enough".

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-01 23:57:27 +00:00
Mateusz Guzik
6d88f9fed6 systat: mostly clean up warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-01 23:11:16 +00:00
Andriy Gapon
e18fbe6f19 fuser: restore functionality by fixing fsid type
Use types from sys/stat.h for the filesystem and inode numbers for extra
safety.

PR:		259504
Reported by:	Markus Wild <freebsd-bugs@virtualtec.ch>
MFC after:	1 week
2021-11-01 08:45:26 +02:00
Stefan Eßer
20f8331aca usr.bin/stat: honour locale for "-t %+"
The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

Reported by:	Jamie Landeg-Jones <jamie@catflap.org>
MFC after:	3 days
2021-10-30 09:00:34 +02:00
Mark Johnston
e9bfb50d5e sort: Fix random sort
bwsrawdata() is supposed to return the string buffer.

PR:		259451
Reported by:	sigsys@gmail.com
Fixes:		d053fb22f6 ("usr.bin/sort: Avoid UBSan errors")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-10-29 14:29:50 -04:00
Baptiste Daroussin
1a4d5f13ba ident: replace sbuf(9) with open_memstream(3)
This change makes ident only dependant on libc functions

This makes our ident(1) more portable, also the fact that we only
depend on libc which is maintained with excellent backward compatibility
means that if one day ident is removed from base, someone using FreeBSD
22 will be able to fetch ident from FreeBSD 14 to run ident against
FreeBSD 1.0 binary

MFC After:	1 week
2021-10-28 15:51:23 +02:00
Ed Maste
48cb3fee25 Retire obsolete iscsi_initiator(4)
The new iSCSI initiator iscsi(4) was introduced with FreeBSD 10.0, and
the old intiator was marked obsolete shortly thereafter (in commit
d32789d95c, MFC'd to stable/10 in ba54910169).  Remove it now.

Reviewed by:	jhb, mav
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32673
2021-10-26 16:17:35 -04:00
Konstantin Belousov
57e5da2c98 Augment systat(1) -swap to display large swap space processes
This change updates the systat(1) -swap display to use libprocstat to
obtain and display per-process swap space usage infomation following its
existing swap devise/file statistics. It also incorporates the disk I/O
information from the -vmstat display.

The new screen looks like below with 'systat -swap':
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9 /10
     Load Average   |

Device/Path       Size  Used |0%  /10  /20  /30  /40  / 60\  70\  80\ 90\ 100|
ada0s1b          2048M 2034M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
zvol/sys/tempora 1024M 1015M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
zvol/sys/swap    1024M 1014M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Total            4096M 4063M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Pid    Username   Command     Swap/Total Per-Process    Per-System
 24153 hiro       seamonkey   98M /   1G  7%              2%
 23677 hiro       xfce4-pane  28M /  81M 34% XXX          0%
 23629 hiro       xfce4-sess  25M / 118M 21% XX           0%
 23681 hiro       xfdesktop   20M /  58M 34% XXX          0%
 23678 hiro       thunar      15M /  43M 36% XXX          0%
 23658 hiro       at-spi-bus  14M /  23M 63% XXXXXX       0%
 23660 hiro       gvfsd       12M /  21M 56% XXXXX        0%

Disks  ada0  ada1  ada2   cd0 pass0 pass1 pass2 pass3
KB/t   8.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
tps       0     0     0     0     1     0     0     0
MB/s   0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
%busy     0     0     0     0     0     0     0     0

Submitted by:	Yoshihiro Ota
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29754
2021-10-26 15:50:29 +03:00
Kyle Evans
f1f7f31366 cmp: initialize limit to avoid stack garbage limits
Pointy hat:	kevans
Fixes:	4e380e8474 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by:	Klara, Inc.
2021-10-21 11:30:55 -05:00
Mateusz Piotrowski
12615938c6 timeout.1: Fix typos in examples
MFC after:	3 days
2021-10-21 13:07:32 +02:00
Konstantin Belousov
2c7a6dad4d ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified
Problem is that rtld cannot reliably access updated environment.
This was made more obvious by bfd4c875a1.  The application
environment can be in arbitrary state and place, system components
can observe it only during execve(2), or in case of rtld, right after
execve, when environment is still at know location and format.

Instead spawn ld-elf.so.1 in direct exec mode which can correctly read
all inherited updates to the environment.

PR:	259069
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:14 +03:00
Konstantin Belousov
ca8c576d10 ldd: style
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:03 +03:00
Baptiste Daroussin
3f550f0191 timeout: style fixes 2021-10-20 10:44:32 +02:00
Baptiste Daroussin
68914dab43 timeout: eliminate usage of sysexits
It brings no value at all the sysexits and maybe misleading as the
return value of timeout(1) matters.
2021-10-20 10:39:34 +02:00
Gleb Smirnoff
1fec1fa814 sockstat: don't query jail vnet if system is running without VIMAGE.
Fixes:  f1cd4902bf
2021-10-19 09:49:35 -07:00
Gleb Smirnoff
32723a3ba9 sockstat: make err(3) on jail errors more verbose. 2021-10-19 09:49:35 -07:00
Ed Maste
e1d6d6f924 lorder: process read-only data symbols
Previously they were skipped.  lorder(1) serves no functional purpose
today but we might as well address this longstanding bug while it is
still in the tree.

PR:		133860
MFC after:	1 week
Submitted by:	John Hein
2021-10-18 17:21:17 -04:00
Alex Richardson
367ec75323 Fix a syntax error in 1b85b68da0
Reported by:	Michael Butler, jenkins
2021-10-14 17:46:28 +01:00
Cameron Katri
1b85b68da0 llvm-readobj: Attach to buildsystem
Also install it as readelf when MK_LLVM_BINUTILS is set.

Reviewed By:	dim, arichardson
Differential Revision: https://reviews.freebsd.org/D32058
2021-10-14 17:18:05 +01:00