Commit graph

2184 commits

Author SHA1 Message Date
Wolfram Schneider
7efa3a6028 fhreadlink.2: fix old typo in the manpage
PR: 282967

(cherry picked from commit fb4cdd51608f3008f035d01f6a499811cda41735)
2024-11-28 14:53:17 +02:00
Ed Maste
2e8ab3d4e9 fork: Document _Fork (and fork) as POSIX 2024
Also remove some information from HISTORY that is no longer needed (and
could be confusing), now that _Fork is part of a standard.

Reported by:	kib
Reviewed by:	imp, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47588

(cherry picked from commit 566c039d1e7555343fcf6439a10e56f5a632c0fe)
2024-11-20 19:45:07 -05:00
Mark Johnston
da80e62f96 linker: Make linker.h more self-contained
struct kld_file_stat embeds a reference to MAXPATHLEN, defined in
param.h.

PR:		280432
MFC after:	2 weeks

(cherry picked from commit f44029e322446469f116bbd26d51ba857083bacb)
2024-11-09 01:10:14 +00:00
Mitchell Horne
ba036fce25 thr_kill(2): fix title
Mandoc emits a STYLE warning due to the lowercase letters.

(cherry picked from commit 23cb03d145292d7a3e6165b4ca74837d497bd3db)
2024-11-04 12:15:11 -04:00
Graham Percival
ddf4df54a7 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464

(cherry picked from commit 6e1fc0118033f42b7c0d3623c8f67a89ebecabb2)
2024-11-04 12:13:13 -04:00
Graham Percival
3609e56813 manuals: Fix errors in .2 pages
These were reported by `mandoc -T lint ...` as errors.

fhlink.2, fhreadlink.2: remove unneeded block closing.

getfh.2, procctl.2: add necessary block closing.

ptrace.2: -width only takes one argument.

swapon.2: <sys/vmparam.h> and <vm/swap_pager.h> weren't being displayed,
    because .It is for a list item whereas .In is for included files.
    Also, we want a blank line between <sys/ > headers and the other
    one.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
PR:		281597
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit 650056363baddb83c61c85b0539ee536f3d4b56c)
2024-11-04 11:56:24 -04:00
Ed Maste
45b0537f0e membarrier: Add manual page
Add a minimal membarrier man page that documents the available cmd
values and errors that can be returned.  We can add more information and
iterate on it in the tree.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46967

(cherry picked from commit 1fc766e3b41d0cdbd166ef95258434069a90ca52)
(cherry picked from commit 92cd5abb64dd70c305535c9504c6a2b73552147f)
(cherry picked from commit 8b41e693fc3956385d5771d60ee93e18001a5a0d)
2024-10-20 23:32:46 -04:00
Mark Johnston
93ff7dbaea socket: Implement SO_SPLICE
This is a feature which allows one to splice two TCP sockets together
such that data which arrives on one socket is automatically pushed into
the send buffer of the spliced socket.  This can be used to make TCP
proxying more efficient as it eliminates the need to copy data into and
out of userspace.

The interface is copied from OpenBSD, and this implementation aims to be
compatible.  Splicing is enabled by setting the SO_SPLICE socket option.
When spliced, data that arrives on the receive buffer is automatically
forwarded to the other socket.  In particular, splicing is a
unidirectional operation; to splice a socket pair in both directions,
SO_SPLICE needs to be applied to both sockets.  More concretely, when
setting the option one passes the following struct:

    struct splice {
	    int fd;
	    off_t max;
	    struct timveval idle;
    };

where "fd" refers to the socket to which the first socket is to be
spliced, and two setsockopt(SO_SPLICE) calls are required to set up a
bi-directional splice.

select(), poll() and kevent() do not return when data arrives in the
receive buffer of a spliced socket, as such data is expected to be
removed automatically once space is available in the corresponding send
buffer.  Userspace can perform I/O on spliced sockets, but it will be
unpredictably interleaved with splice I/O.

A splice can be configured to unsplice once a certain number of bytes
have been transmitted, or after a given time period.  Once unspliced,
the socket behaves normally from userspace's perspective.  The number of
bytes transmitted via the splice can be retrieved using
getsockopt(SO_SPLICE); this works after unsplicing as well, up until the
socket is closed or spliced again.  Userspace can also manually trigger
unsplicing by splicing to -1.

Splicing work is handled by dedicated threads, similar to KTLS.  A
worker thread is assigned at splice creation time.  At some point it
would be nice to have a direct dispatch mode, wherein the thread which
places data into a receive buffer is also responsible for pushing it
into the sink, but this requires tighter integration with the protocol
stack in order to avoid reentrancy problems.

Currently, sowakeup() and related functions will signal the worker
thread assigned to a spliced socket.  so_splice_xfer() does the hard
work of moving data between socket buffers.

Co-authored by:	gallatin
Reviewed by:	brooks (interface bits)
MFC after:	3 months
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D46411

(cherry picked from commit a1da7dc1cdad8c000622a7b23ff5994ccfe9cac6)
2024-10-17 15:48:36 +00:00
Konstantin Belousov
27af5dad16 getrlimitusage.2: add the man page
(cherry picked from commit 3670421e21932c44225b9457c50dd67da3abcd84)
2024-10-10 12:10:33 +03:00
Konstantin Belousov
dac3b7e394 Userspace enablement for getrlimitusage(2)
(cherry picked from commit 9b29fc89ae20a22516f54e146bfdfa0cfcd60b8b)
2024-10-05 10:08:55 +03:00
Konstantin Belousov
d20f0dae2f getrlimit(2): document RLIMIT_PIPEBUF
(cherry picked from commit 54a8d1fbbf65e976132809718525ba051a5525cf)
2024-10-05 10:08:54 +03:00
Fernando Apesteguía
ddbbc129ae faccessat(2): Honor AT_SYMLINK_NOFOLLOW
Make the system call honor `AT_SYMLINK_NOFOLLOW`.

Also enable this from `linux_faccessat2` where the issue arised the first time.
Update manual pages accordingly.

PR:			275295
Reported by:		kenrap@kennethraplee.com
Approved by:		kib@
Differential Revision:	https://reviews.freebsd.org/D46267

(cherry picked from commit 5ab6ed93cd3680f8b69dd4d05823f4740a2bdef9)
2024-09-26 09:13:50 -04:00
Konstantin Belousov
ba08efe3f2 getrlimit(2): document RLIMIT_UMTXP
(cherry picked from commit 3a2a5d606082dd782594b393c3920b9478698f07)
2024-09-22 00:19:49 +03:00
Jose Luis Duran
f7eb6b134d open(2): Extend EINVAL's description
PR:	281033

(cherry picked from commit 02c23c3b5ac9c9c1115c8b892034bb5d67b05c06)
2024-09-01 03:53:36 +03:00
Jose Luis Duran
97ccb41979 rename(2): Extend EINVAL's description
PR:	281033

(cherry picked from commit 33f58ac0795b2b02593ad0a8bf8a1ea24c1dc5e1)
2024-09-01 03:53:36 +03:00
Jose Luis Duran
f968e0819d open(2): mandoc -T lint
(cherry picked from commit f5a37f8dd319e3007b126b77376e61ad96f44d8b)
2024-09-01 03:53:36 +03:00
Dag-Erling Smørgrav
79b39f23e1 access(2): Discourage use of these system calls.
Fixes:		421025a274fb
PR:		262895
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45240

(cherry picked from commit a4be1eb21165d7aedae9dc6634528619ff10d025)
2024-05-23 04:41:32 +02:00
Gordon Bergling
f075b61137 access.2: Mention that lstat(2) should be used for symbolic links
access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note in the manual page, that lstat(2) should be
used in the case of symbolic links.

PR:	262895
Reviewed by:	gbe, pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44890

(cherry picked from commit 421025a274fb5759b3ecc8bdb30b24db830b45ae)
2024-05-23 04:41:32 +02:00
Alexander Ziaee
828e648b26 intro.2 as errno.2: Update maximum hard link limit
MFC after:	1 week
Co-authored-by: brooks
Reviewed by:	brooks, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1192

(cherry picked from commit 6dfbe695c3223822734dddc926415a3ba347b42c)
2024-05-20 21:15:00 -06:00
Alexander Ziaee
cbe2436dda intro.2: Add sys/syscall.h to SYNOPSIS
MFC after:	1 week
Co-authored-by: brooks
Reviewed by:	brooks, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1192

(cherry picked from commit 69ff2d754c1c8bd9c2b6cea28aa754e9f92f9613)
2024-05-20 21:14:13 -06:00
Ed Maste
0e0220d11a clock_gettime.2: fix markup
The CLOCK_* constants are "defined variable or preprocessor constants"
and so use .Dv.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45106

(cherry picked from commit 2d29d2ecebf8ea19221995b3ea2e3a7ac700bf81)
2024-05-10 09:01:52 -04:00
Mateusz Piotrowski
ba13e6546d gettimeofday.2: Do mention improbable future removal
As kib@ noted:

> Obviously gettimeofday(2) is not going to be removed
> even in the far future.

Reported by:	kib
Fixes:		4395d3ced5cf Document that gettimeofday() is obsolescent
MFC after:	3 days

(cherry picked from commit 6662c2312e956439652ce2d06b42753b6a78fc61)
2024-05-04 15:05:09 +02:00
Mateusz Piotrowski
c32f8e613e Document that gettimeofday() is obsolescent
Reported by:	kaktus
Reviewed by:	kaktus, pstef
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23942

(cherry picked from commit 4395d3ced5cfa46df400b5bb9996f9d74476997e)
2024-05-04 15:04:47 +02:00
Konstantin Belousov
afc8b17816 sigqueue(2): Document __SIGQUEUE_TID
(cherry picked from commit dcc180c51b9c13df3d1158d14d450308711fe93c)
2024-04-30 03:48:09 +03:00
Gordon Bergling
499d4a6094 timerfd.2: Remove a double word
- s/is is/is/

(cherry picked from commit bbef63ec27fdb86814e34c4b4013cd92ba86bc42)
2024-04-23 07:22:46 +02:00
Christopher Davidson
ac4ddd8b1f open.2: remove self-reference
Change .Xr reference to .Fn, which quiets a mandoc warning.

Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1135

(cherry picked from commit d3de1bd429bc51fbbcb37fadaf2581461edf848b)
2024-04-18 15:18:34 -03:00
Ed Maste
c3c75c142c open: make non-POSIX errno value more apparent
In the errno list, add an explicit note and reference to the note in the
STANDARDS section.

When O_NOFOLLOW is specified and the target is a symbolic link FreeBSD
sets errno to a value different than that specified by POSIX.  Commit
295159dfa3 added a note to this effect, but I missed it when reading
through the list of errno values.

PR:		214633
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43618

(cherry picked from commit ea6a6b63e1fd304e790c8ed7627caf5e3ba52bc7)
2024-03-22 09:30:30 -04:00
Andrew Turner
bce8a0ba15 libc: Teach libc about the BTI elf note
Add the Branch Target Identification (BTI) note to libc assembly
sources. As all obect files need the note for the library to have it
we need to insert it in all asm files.

Reviewed by:	emaste, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42228

(cherry picked from commit fd5aaf2ea0178b03aa93c35245053247e5d3840c)
2024-02-19 13:17:37 +00:00
Konstantin Belousov
8309579720 Document aio_read2/aio_write2
(cherry picked from commit a52cb4c480f270fc7158a0f58179f7b80d8a5b3c)
2024-02-18 12:01:46 +02:00
Konstantin Belousov
1298ecb6ba lio_listio(2): add LIO_FOFFSET flag to ignore aiocb aio_offset
(cherry picked from commit e4b7bbd6ab77e908a60362aa29e518f224a117b0)
2024-02-18 12:01:46 +02:00
Konstantin Belousov
16b1438c73 read.2: Describe debug.iosize_max_clamp
PR:	276937

(cherry picked from commit 3e9515846f8cbff0ecccaab65d9f70890d04429e)
2024-02-14 05:41:54 +02:00
Konstantin Belousov
14b7cf92e7 open(2): describe *at behavior for dirfd opened without O_SEARCH
(cherry picked from commit a570fe4d0dd979ce099374259ffc45d56ae4e471)
2024-02-01 02:30:40 +02:00
Mark Johnston
ea3197e69b kcmp: Add a manual page
Reviewed by:	kib, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43562

(cherry picked from commit af0d437dd31f71726f7eb5e9aca9fbd374a8277a)
2024-01-31 09:16:29 -05:00
Konstantin Belousov
f8d885c08d Add kcmp(2) userspace bits
(cherry picked from commit 211bdd601ee51f90da9b123807ef68ac122116b9)
2024-01-30 22:24:42 +02:00
Gordon Bergling
c75648dc9b sigfastblock.2: Fix a typo in the manual page
- s/successfull/successful/

(cherry picked from commit a70008e95b907336bddbcc2aa9d567df6e3a41b6)
2024-01-23 07:43:27 +01:00
Gordon Bergling
9509e32f9e _umtx_op.2: Fix a typo in the manual page
- s/interpeted/interpreted/

(cherry picked from commit b2ec175fcaac90fc6a1caf066656eaa092f32611)
2024-01-23 07:40:33 +01:00
Alan Somers
5b4873c5b8 Remove _POSIX_PRIORITIZED_IO references from man pages
We don't support it, so there's no need to tell readers what would
happen if we did.  Also, don't remind the user that a certain field is
ignored by aio_read.  Mentioning every ignored field would make the man
pages too verbose.

Sponsored by:	Axcient
Reviewed by:	Pau Amma <pauamma@gundo.com>
Differential Revision: https://reviews.freebsd.org/D42622

(cherry picked from commit 18e2c4175f78f1aaa648dd7fb7530220aed23671)
2024-01-19 18:52:18 -07:00
Alan Somers
f9f7404cd5 sigaction.2: clarify that fork isn't async-signal-safe, but _Fork is
[skip ci]

Sponsored by:	Axcient
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D42865

(cherry picked from commit c2ed7a63604fc86244adee2966e19f8aba2a07cb)
2024-01-19 18:51:27 -07:00
Tom Hukins
554b8bc907 Fix "version introduced" in numerous manual pages
Pull request:	https://github.com/freebsd/freebsd-src/pull/853

(cherry picked from commit ba719a0fec8f831aef4b23de0ff36fd47bb26651)
2024-01-15 10:20:56 -05:00
Mark Johnston
8ac8b0b6aa setfib.2: Consistently capitalize "FIB"
MFC after:	1 week
Sponsored by:	Klara, Inc.

(cherry picked from commit ee7d5ba1b55441476643983d3f70df5ee9ea97c4)
2024-01-11 09:18:12 -05:00
Rick Macklem
5c4da68ad7 copy_file_range.2: Clarify that only regular files work
PR#273962 reported that copy_file_range(2) did not work
on shared memory objects and returned EINVAL.
Although the reporter felt this was incorrect, it is what
the Linux copy_file_range(2) syscall does.

Since there was no collective agreement that the FreeBSD
semantics should be changed to no longer be Linux compatible,
copy_file_range(2) still works on regular files only.

This man page update clarifies that. If, someday, copy_file_range(2)
is changed to support non-regular files, then the man page will
need to be updated to reflect that.

PR:	273962

(cherry picked from commit 84b4342c0d7ac8a3187309a978d41e6765154cc1)
2024-01-10 17:13:23 -08:00
Brooks Davis
1b0471936f libc: simplify MDASM/NOASM checks
Use boolean evaluation of :M matches and a single if statement.

Reviewed by:	imp, kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42915

(cherry picked from commit fc0288993cdad8a559fcd2c2166cf95f1fa43745)
2024-01-02 16:59:04 +00:00
Brooks Davis
9467188141 libc: Centralize non-building of sbrk stubs
The actual implementation of sbrk(2) is on top of the undocumented
break(2) system call.  On powerpc* this means we don't build _sbrk and
__sys_sbrk which were neither used nor exposed for linkage.  Otherwise
it is a no-op.

The addition to lib/libc/sys/Makefile.inc is a direct commit to
stable/14 in lieu of merging the removal of the sbrk and sstk syscalls.

(cherry picked from commit 7893419d492c40ca82b68fca3dcc0f5f7047d39b)

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43159
2024-01-02 16:22:13 +00:00
Brooks Davis
89ebe0ce1f memfd_create: move implementation to libc/gen
Due to memfd_create(3)'s construction of a path to pass to shm_open2(2),
it has a much larger than typical dependency footprint for a system
call wrapper (the list currently includes calloc, memset, sprintf, and
strlen).  As such, split it off into its own file under libc/gen to
lighten libc/sys's dependency list.

Reviewed by:	kevans, imp, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42709

(cherry picked from commit c3207e2d2554c8e36f9cf5950f8cd52a19fedfd5)
2023-12-21 18:13:18 +00:00
Brooks Davis
acf0f65f52 libc: remove unused stub vdso timecounter implementations
All supported architectures have shared page support so remove this
unused stub.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D42619

(cherry picked from commit 500bf0592cf1de1d26369efe3877d812f724f5c0)
2023-12-13 22:08:14 +00:00
Brooks Davis
e150833764 libc: further centralize syscall symbols
All architectures necessarily implement _exit(2) and vfork(2) so
declare them in sys/Symbol.map.

Reviewed by:	imp, kib, emaste
Differential Revision:	https://reviews.freebsd.org/D42614

(cherry picked from commit e4a1800f06884dc00931f55d0fa8cd9ce473a83e)
2023-12-13 22:08:13 +00:00
Brooks Davis
695639d2f4 libc: Remove empty comments in Symbol.map
These were left over from $FreeBSD$ removal.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42612

(cherry picked from commit 1ca63a8219b88b752b064d19bd3428c61dbcf1f9)
2023-12-13 22:08:13 +00:00
Brooks Davis
1c63aa2989 procctl.2: improve phrasing for ASLR disable
Reported by:	jrtc27
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D42364

(cherry picked from commit 4894205482555447c6b3372598c7589a66596724)
2023-12-02 00:03:25 +00:00
Alan Somers
f23f9941f1 aio_read.2: correct the description of aio_buf
Looks like a copypasta from aio_write.2.

[skip ci]

Reported by:	Paul Floyd <pjfloyd@wanadoo.fr>
Sponsored by:	Axcient
Reviewed by:	jilles (manpages)
Differential Revision: https://reviews.freebsd.org/D42621

(cherry picked from commit 04cfe6c12ccc75624dc87ab8f44c4852b16f0c4f)
2023-11-30 13:38:09 -07:00
Warner Losh
4025b5b527 libc: Purge unneeded cdefs.h
These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42385

(cherry picked from commit 559a218c9b257775fb249b67945fe4a05b7a6b9f)
2023-11-26 21:20:09 -07:00