master
Add pathconfat(2): pathconf(2) but with at-fd and flags arguments, the latter supporting the ability to get timestamp resolution of symlinks.
Prefer "get or set" over "get/set" or "get and set".
Point to <signal.h> and not <sys/signal.h>: the latter is an implementation detail for the kernel, libc, and libkvm, and should not be a concern for others.
Validate timespec and return ECANCELED when interrupted with SA_RESTART.
grammar
.Li -> .Vt where appropriate; from josiah frentsos, tweaked by schwarze
don't mention what language functions are implemented in remove a line relating to the 2BSD libNS ok schwarze@
Make consistent reference to pathname.
adjfreq(2): limit adjustment to [-500000, +500000] ppm
adjtime(2): set EINVAL if delta overflows 64 bits of microseconds.
man pages: add missing commas between subordinate and main clauses
sbrk(2) already existed in Version 4 AT&T UNIX; source: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man2/break.2 pointed out by Sevan Janiyan <venture37 at geeklan dot co dot uk>
Move mutex, condvar, and thread-specific data routes, pthread_once, and pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread.
use .In rather than .Fd #include
change some 4.4BSD references to earlier releases ok schwarze@
document EFTYPE, clarify +t on file behaviour; OK millert
remove references to fs.posix.setuid; ok tedu
delete an ancient paragraph suggesting the wrong reason to use close(2) (and we all laughed a little)
Note closefrom(2)'s origins in Solaris 9.
sockatmark(3), recv(2), getsockopt(2), and connect(2) return specifically -1 to mark failure, not arbitrary values < 0. I believe manual pages should follow the described contract precisely and accurately.
During open(2), release the fdp lock before calling vn_open(9). This lets other threads of the process modify the file descriptor table even if the vn_open(9) call blocks.
controm terminql -> controlling terminal;
fcntl(2) first appeared in System III ok schwarze@
Use the same text for EOPNOTSUPP as we do in fcntl(2) and lockf(3). In fcntl(2) and lockf(3) the error is EINVAL but the condition is the same. OK anton@
describe EIO failure state. noted by Maximilian Lorlacks
missing full stop
Simple macro fixes (Fd -> In, Nm -> Fn) from Kaspars at Bankovskis dot net. No content change.
getentropy(2) is in POSIX-2024, so adjust the #include visibility, change the "too much" error to EINVAL, add GETENTROPY_MAX to <limits.h> (via sys/syslimits.h), and update the manpage.
we mention interim BSD releases so change some 4.4BSD use to 4.3BSD-Reno ok jmc@ schwarze@
Get rid of an old convention of wrapping preprocessor constants in curly braces.
add missing RETURN VALUES section; also checked that POSIX requires exactly this behaviour
Prefer 'argument' over 'parameter' when refering to the value passed in a specific call.
add history for getpid(2) and getppid(2)
Be clear that RUSAGE_CHILDREN only works for terminated children that have been waited for. If you SIG_IGN SIGCHLD or don't call any of the wait functions then RUSAGE_CHILDREN wont report anything. OK deraadt@ millert@
Implement SO_ACCEPTCONN in getsockopt(2) Requested by robert@ OK mvs@ millert@ deraadt@
some Xr adjustment to catch up with MLINKS removal;
tweak previous: cull a stray .Pp that crept in and caused a warning: mandoc: intro.2:164:2: WARNING: skipping paragraph macro: Pp before It
improve legibility of structs in several manpages
correct Research Unix edition "appeared in" use in HISTORY
kqueue: Implement EVFILT_USER
adjust documentation for ktrace.h changes. utrace() is now easier to use ok guenther
The source of a link (name1) may not be a directory.
update docs on madvise/msync/minherit behaviour in relation to immutable memory; ok kettenis
timecounting: use full 96-bit product when computing elapsed time
mkdir(2) and mkdirat(2) can also fail with EACCESS if write permission is denied on the parent directory of the directory to be created. From FreeBSD. OK deraadt@ natano@
mincore() is a relic from the past, exposing physical machine information about shared resources which no program should see. only a few pieces of software use it, generally poorly thought out. they are being fixed, so mincore() can be deleted. ok guenther tedu jca sthen, others
sort SEE ALSO;
MNT_SOFTDEP and mount -o softdep no longer have any effect OK kn@ jmc@
Add Xr mimmutable to manual pages which discuss immutable memory. prodding from kettenis
add typedefs for msgqnum_t and msglen_t, required by POSIX.
add STANDARDS, improve HISTORY, and basic macro cleanup: use .Vt for struct names and and .Fa for struct fields
obvious bugfix: if the queue is removed while message transmission is blocked, POSIX requires EIDRM rather than EINVAL, and that's what our implementation does and what the ERRORS section already says, too
Fix a (mostly) hypothetical race in pinsyscalls(2) by making it return an error if called in a multi-threaded process. The race would involve an alternate ld.so implementation that starts threads before loading libc.so, which is just a bad idea. Several ideas to fix the race have been bounced around but those either involve an additional per-syscall cost or some convoluted variable dependencies (that would still require an explicit barrier on alpha). That's simply not worth it.
use .Rv and simplify wording; from Kaspars at Bankovskis dot net
remove inaccurate system call lists in the [rwc]path promises, and simplify description of the charactistics of these promises by describing them compared to each other. issue pointed out by claudio and tb. ok ingo jmc
ppoll() is in POSIX-2024. Update #include visibility and manpages and add restrict qualifiers. While here, rename the BUGS section to CAVEATS since they're really "these probably don't do what you want" notes and not things that need fixing.
Use PROTO_NORMAL() on __syscall to go direct, adjusting the declaration to eliminate some casts. Retire some uses of old-style STUB* macros where superseded by namespace.h bits
Revert 1.14 of lib/libc/sys/profil.2 since it's changed by accident by my previous commit.
Merge the sigaction() and sigprocmask() overloads/wrappers from libpthread into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need.
Add ptrace commands used to read/write the XSAVE area of a traced process. Intended to give debuggers access to xmm/ymm registers.
Turd polish: use HIDDEN= instead of PSEUDO= for ptrace syscall stub, to make its underlying symbol name look like others.
Document RB_TIMEBAD; delete RB_* that are obsolete/unimplemented
add space needed in punctuation; from josiah frentsos
more trivial .Ar -> .Fa replacements in syscall manuals
Add sched_yield(2) manpage
In 1999 fd_set overflowing beyond FD_SETSIZE became enough of a problem that I changed the entire tree to use fd_set allocation, and this manpage documented the "calloc(howmany(max+1, NFDBITS), sizeof(fd_mask))" idiom. Since then we completed converting the entire tree to poll(2), for many reasons, even ssh/sshd. Now the use of kernel-only sys/param.h-found howmany() and related macross grate on me, so it is time to recommend use of poll(2) instead. [On a related note, MacOS poll(2) is been dangerously broken for many years; that is their problem to handle as the whole ecosystem joins us in pivoting select -> poll) ok millert
KNF
spread some ipcrm/ipcs Xr; from mikhail ok schwarze
Add libc wrappers for the new sendmmsg and recvmmsg system calls. Feedback tb@, miod@, jca@ OK jca@
Early daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8) are started before syslogd(8). This resulted in ugly sendsyslog(2) dropped logs and the real message was lost. Create a temporary stash for log messages within the kernel. It has a limited size of 100 messages, and each message is truncated to 8192 bytes. When the stash is exhausted, the well-known dropped message is generated with a counter. After syslogd(8) has setup everything, it sends a debug line through libc to flush the kernel stash. Then syslogd receives all messages from the kernel before the usual logs. OK deraadt@ visa@
macro cleanup; from Kaspars at Bankovskis dot net
macro fixes from Kaspars at Bankovskis dot net; also fixing one typo in fts(3) while here
The {get,set}res[ug]id(2) family are in POSIX-2024's XSI option, so adjust the #include visibility and update the manpage.
remove outdated "expected to be compliant" ok miod@ kn@ deraadt@
tweak previous;
shmaddr is a pointer, so use NULL instead 0f
Per POSIX, we now only require <sys/msg.h>, <sys/sem.h>, or <sys/shm.h>
Identify domains with AF_* instead of PF_* here Tweaks to SYNOPSIS and RETURN VALUES
spelling
lower parts of the manual page clearly say why using malloc() to allocate sigaltstack regions is bad... so the example code should not use malloc()... ok semarie
It is distasteful to have manual pages which don't refer to real function calls, but instead a "class" of functions like "sigsetops". Rename to sigaddset", and while at it improve documentation in sigprocmask(2) to point to it. ok tedu
libc stub is gone, so update the description to cover the remaining use
Actually describe the parameters rather than calling facts BUGS that aren't even small bugs. And stop talking about AF_LOCAL. Feedback and OK guenther@, OK jmc@.
clang doesn't propagate attributes like "asm labels" and "visibility(hidden)" to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error.
changing EINVAL from "has no associated size" to "has insufficient size" does a better job of covering the case of partition not configured (size = 0) or other too-small decision the kernel may make
nd6_debug sysctl is gone.
This is thrkill, not __thrsigdivert
Make these timer_* stubs weak symbols Provide declarations to reduce noise when using -Wmissing-prototypes
Respect RLIMIT_FSIZE when extending a file via truncat(2)/ftruncate(2). This refactors the commin parts of sys_truncate() and sys_ftruncate() into dotruncate(). If the new size of the file is larger than the RLIMIT_FSIZE limit _and_ the file is being extended, not truncated, return EFBIG. Adapted from a diff by Piotr Durlej. With help from and OK by deraadt@ guenther@.
Avoid gendered language in man pages when not referring to a specific person. Rewrite or use singular they.
document EFAULT, and replace all 'It Er' errno with 'It Bq Er'
adjust protos for utimes/futimes to use [2], and then add documentation regarding EINVAL for denomalized time values (sub-second out of range) ok jmc millert, discussion with kettenis
Use a Thread Information Block in both single and multi-threaded programs. This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!
Add support for timeconting in userland.
waitid(2) returns 0 on success; do post-call cancelation only if it either failed, or succeeded but didn't put a status into infop.
Add waitid(2) manpage, based on a first pass by espie@ and bits from FreeBSD and NetBSD.
- some small tweaks for the text - on guenther's advice, remove NOTES: the text is either not relevant or already described correctly elsewhere
writev() appeared in 4.1c before 4.2
repair error section; Martin Vahlensieck