aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys
Commit message (Collapse)AuthorAgeFilesLines
* chroot.2: Update errors and unprivileged useEd Maste44 hours1-16/+33
| | | | | | | | | | | | | Include errors common to chroot and fchroot in a single list, followed by errors unique to each. Unprivileged chroot is permitted if the security.bsd.unprivileged_chroot sysctl is set to 1. Make note of this and update the EPERM description. Reported by: kevans Reviewed by: kevans, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51703
* sysent: regen for const __sysctl argumentBrooks Davis3 days1-2/+2
|
* getsockopt.2: Add SO_SPLICE source socket read and socket close behaviorKevin Bowling9 days1-0/+9
| | | | | | | | | | | | Add select(2), poll(2), or kqueue(2) source socket semantics and close behavior. Reported by: Udip Pant <upant@netflix.com> Reviewed by: manpages (ziaee), markj Obtained from: OpenBSD MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51547
* mkdir.2: Correct HISTORYKen Wong12 days1-1/+1
| | | | | | PR: 286064 MFC after: 3 days Reviewed by: mckusick
* statfs.2: Fix named_attribute man sectionRick Macklem2025-07-201-3/+3
| | | | | | This is a content change. Fixes: 964d0fd62431 ("statfs.2: Update man page for the MNT_NAMEDATTR flag")
* fhopen.2: Fix named_attribute man sectionRick Macklem2025-07-201-2/+2
| | | | | | This is a content change. Fixes: dedbb972d294 ("fhopen.2: Update man page for O_NAMEDATTR flag")
* getdirentries: Return ENOTDIR if not a directory.Dag-Erling Smørgrav2025-07-091-4/+6
| | | | | | | | | | | | | | | This is both more logical and more useful than EINVAL. While here, also check for VBAD and return EBADF in that case. This can happen if the underlying filesystem got forcibly unmounted after the directory was opened. Previously, this would also have returned EINVAL, which wasn't right but wasn't wrong either; however, ENOTDIR would not be appropriate. MFC after: never Sponsored by: Klara, Inc. Reviewed by: kevans, kib Differential Revision: https://reviews.freebsd.org/D51209
* fcntl.2: fix description of F_GETFD return valueKonstantin Belousov2025-07-081-1/+1
| | | | | | Now we have three flags provided. Sponsored by: The FreeBSD Foundation
* Add manpages for O_CLOFORK flag and othersRicardo Branco2025-07-0610-16/+128
| | | | | | Reviewed by: kib MFC after: 1 month Pull Request: https://github.com/freebsd/freebsd-src/pull/1698
* pathconf.2: Document the _PC_HAS_HIDDENSYSTEM nameRick Macklem2025-07-061-1/+10
| | | | | | | | | | | | | Commit afd5bc630930 added a new pathconf name _PC_HAS_HIDDENSYSTEM. This patch documents this new name. This is a content change. Reviewed by: kib, ziaee (manpages) Differential Revision: https://reviews.freebsd.org/D51175 Fixes: afd5bc630930 ("pathconf: Add a new variable for hidden/system")
* inotify: Add man pages for the new syscalls and for VOP_INOTIFYMark Johnston2025-07-042-0/+385
| | | | | | | Reviewed by: kib MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50315
* libsys: Add inotify supportMark Johnston2025-07-041-0/+2
| | | | | | | | | Include the two new syscalls in the symbol map. Reviewed by: kib MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50315
* inotify: Regenerate syscall definitionsMark Johnston2025-07-042-0/+8
| | | | Sponsored by: Klara, Inc.
* write.2: Add EINVAL to ERRORSFelix Johnson2025-07-041-0/+3
| | | | | | | | | | | | | | | | | | Since phk rewrote the block layer ~2 decades ago, write(2) can return EINVAL when the target is a block device and nbytes, the write size, is not a multiple of the sector's block size. From the original PR: When coming from Linux, people are surprised by the fact that write(2) to a device must be aligned to block size. Writing a non-aligned block onto a raw device is a case where EINVAL is also returned but the manpage does not mention this. MFC after: 3 days PR: 227185 Reported by: riggs Reviewed by: imp, Pau Amma <pauamma@gundo.com> Differential Revision: https://reviews.freebsd.org/D51138
* libsys: Add AT_HWCAP3 and AT_HWCAP4Andrew Turner2025-06-242-3/+33
| | | | | | | | This is needed to read these values. Reviewed by: brooks, imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51006
* sendfile: retire SF_SYNCGleb Smirnoff2025-06-241-7/+1
| | | | | | | | | | | | The flag was added in b75a1171d8ba4 for the sake of Varnish. However, that idea didn't work. Quoting email from Poul-Henning: "We had to give up sendfile(), the overhead of keeping track of everything between the network stack and VM system made ate any gain we saw. ... I dont think we ever shipped a version where sendfile was enabled by default." PR: 287348
* file: Add a fd flag with O_RESOLVE_BENEATH semanticsMark Johnston2025-06-241-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that they remain under the directory referenced by the dirfd. This commit introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored in the file descriptor entry. When the flag is set, any lookup relative to that fd automatically has O_RESOLVE_BENEATH semantics. Furthermore, the flag is sticky, meaning that it cannot be cleared, and it is copied by dup() and openat(). File descriptors with FD_RESOLVE_BENEATH set may not be passed to fchdir(2) or fchroot(2). Various fd lookup routines are modified to return fd flags to the caller. This flag will be used to address a case where jails with different root directories and the ability to pass SCM_RIGHTS messages across the jail boundary can transfer directory fds in such as way as to allow a filesystem escape. PR: 262180 Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D50371
* kern: send parent a SIGCHLD when the debugger has detachedKyle Evans2025-06-192-3/+17
| | | | | | | | | | | | | | | | | | | | | | The practical scenario that leads to this is porch(1) spawning some utility and sending it a SIGSTOP as a debugging aide. The user then attaches a debugger and walks through how some specific input is processed, then detaches to allow the script to continue. When ptrace is detached, the process resumes execution but the parent is never notified and may be stuck in wait(2) for it to continue or terminate. Other platforms seem to re-suspend the process after the debugger is detached, but neither behavior seems unreasonable. Just notifying the parent that the child has resumed is a relatively low-risk departure from our current behavior and had apparently been considered in the past, based on pre-existing comments. Move p_flag and p_xsig handling into childproc_continued(), as just sending the SIGCHLD here isn't really useful without P_CONTINUED set and the other caller already sets these up as well. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D50917
* clock_gettime: Better markupWarner Losh2025-06-131-1/+3
| | | | | | | | Markup CLOCK_REALTIME better. Noticed by: kib Fixes: 7b7ba7857ce8 Sponsored by: Netflix
* kern_time: minor style nitsWarner Losh2025-06-131-1/+3
| | | | | | | | | Typically we spell error values 'error' not 'err'. And fix EINVAL markup nit. Suggested by: kib Fixes: 7b7ba7857ce8 Sponsored by: Netflix
* Implement CLOCK_TAINathan Whitehorn2025-06-124-4/+19
| | | | | | | | | | | | | | Provide a clock through clock_gettime() that returns the current TAI time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This provides compatibility with Linux, which also provides a CLOCK_TAI since kernel 2.6.26, and this seems to be becoming the standard way to acquire TAI time. Unlike Linux, this code will return EINVAL if the TAI offset (set by ntpd, ptpd, etc.) is not known since it seems pathological for CLOCK_TAI to silently give the wrong (UTC) time if the offset is not known as it does on Linux. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46268
* open.2: Document the O_NAMEDATTR flagRick Macklem2025-06-041-2/+47
| | | | | | | | | | | | | | | | Commit 2ec2ba7e232d added support for the O_NAMEDATTR flag to the open(2) and openat(2) syscalls for main. This patch updates the man page for this flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Reviewed by: emaste (earlier version), kib (earlier version) Differential Revision: https://reviews.freebsd.org/D49691 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
* RegenKonstantin Belousov2025-05-312-0/+4
|
* libsys: export exterrctl symbolKonstantin Belousov2025-05-311-0/+1
| | | | | | | Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D50483
* thr_new.2: document THR_C_RUNTIMEKonstantin Belousov2025-05-311-0/+9
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* amd64: add amd64_set_tlsbase(3)Konstantin Belousov2025-05-283-0/+56
| | | | | | | | Tested by: pho Reviewed by: olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50482
* write.2: sweep error code referencing disklabel(8)Robert Wing2025-05-271-7/+0
| | | | | | | | The "-W" option for disklabel(8) was retired in: f080d33b66306419b40c2f2a879198d3d5a8d36c The ioctl used by the "-W" option, DIOCWLABEL, was retired in: 5777c5b9895805c33f1da4f72a3b5b297727888b
* open.2: add a note about conversion of a file descriptor into O_PATHKonstantin Belousov2025-05-251-0/+7
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D50511
* Fix incorrect version introduced in manual pagesTom Hukins2025-05-052-2/+2
| | | | | | | | | | | | | | Several manual pages for releng/14.3 incorrectly claim that features were first introduced in FreeBSD 15.0. I discovered these by running: git checkout origin/releng/14.3 git grep -F '.Fx 15.0' MFC After: 3 days Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1685
* pathconf.2: Document the _PC_HAS_NAMEDATTR nameRick Macklem2025-05-041-1/+3
| | | | | | | | | | | | | Commit 0f12c3cd0ddb adds a new pathconf(2) name called _PC_HAS_NAMEDATTR. This patch documents it in the man page. This is a content change. Reviewed by: ziaee (manpages) Differential Revision: https://reviews.freebsd.org/D50141 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
* time: use precise callout for clock_nanosleep(2) and nanosleep(2)Gleb Smirnoff2025-04-301-9/+43
| | | | | | | | | | | | | | | | | | | | | Don't apply tc_precexp and TIMESEL() that uses sbt_timethreshold (both derivatives of kern.timecounter.alloweddeviation) to sleep callout when processing the default and precise clocks. The default timer deviation of 5% is our internal optimization in the kernel, and we shouldn't leak that into the POSIX APIs. Note that application doesn't have any control to cancel the deviation, only a superuser can change the global tunable [with side effects]. Leave the deviation for CLOCK_*_FAST and CLOCK_SECOND that are documented as imprecise. Provide a sysctl kern.timecounter.nanosleep_precise that allows to restore the previous behavior. Improve documentation. Reviewed by: ziaee, vangyzen, imp, kib Differential Revision: https://reviews.freebsd.org/D50075
* procctl.2: Fix names of PROC_LOGSIGEXIT_CTL constantsVicki Pfau2025-04-211-9/+9
| | | | | | | | | The headers contain constants that start with PROC_LOGSIGEXIT_CTL_*, but the man page elided the _CTL portion. Fixes: dabf006 ("Add per-process flag to disable logsigexit") Reviewed by: imp, jlduran Pull Request: https://github.com/freebsd/freebsd-src/pull/1610
* pathconf.2: Update man page for the _PC_NAMEDATTR_ENABLED flagRick Macklem2025-04-161-1/+3
| | | | | | | | | | | This patch updates the man page for the _PC_NAMEDATTR_ENABLED flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
* symlink.2: document EOPNOTSUPPMichael Tuexen2025-04-141-1/+5
| | | | | | | | | | | When the file system does not support symbolic links (like in the case of MSDOS), symlink() returns -1 and sets errno to EOPNOTSUPP. Document this behavior. Reviewed by: glebius, markj MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D49803
* statfs.2: Update man page for the MNT_NAMEDATTR flagRick Macklem2025-04-111-2/+6
| | | | | | | | | | | | | This patch updates the man page for the MNT_NAMEDATTR flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Reviewed by: manpages (zaiee) Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes") Differential Revision: https://reviews.freebsd.org/D49719
* fhopen.2: Update man page for O_NAMEDATTR flagRick Macklem2025-04-101-2/+17
| | | | | | | | | | | | | This patch updates the man page for the O_NAMEDATTR flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Reviewed by: manpages (zaiee) Fixes: 2ec2ba7e ("Add support for Solaris style extended attr") Differential Revision: https://reviews.freebsd.org/D49718
* Bump .Dd for recently changed aio_*(2) manpagesEnji Cooper2025-03-283-3/+3
| | | | | | | | | | The ones that were effectively unchanged from d97e44784bb5a^..e24279e0f9e did not have `.Dd` bumped. Only the ones that had a net content change between those revisions. MFC after: 2 weeks MFC with: d97e44784bb5a e24279e0f9e
* Remove mentions of ENOSYS added in d97e44784bb5Enji Cooper2025-03-289-63/+0
| | | | | | | | | | | | | | | aio(4) is a hard requirement in the kernel as of f3215338ef82. The scenario that the patch was submitted for is no longer possible. This isn't a straight up revert since the previous change also addressed some minor issues. PR: 190942 Reported by: asomers MFC after: 2 weeks MFC with: d97e44784bb5 Fixes: d97e44784bb5 ("aio_*(2): mention ENOSYS under ERRORS") Differential Revision: https://reviews.freebsd.org/D49541
* aio_*(2): mention ENOSYS under ERRORSEnji Cooper2025-03-269-4/+71
| | | | | | | | | | | | | | | ENOSYS can occur if aio(4) is not loaded in the kernel. Document this behavior so consumers on FreeBSD can better understand that this is a possible scenario. Clean up the manpages slightly while here: - Sort `ERRORS` by errno(3). - Use `.Fx` instead of `FreeBSD`. MFC after: 2 weeks Reviewed by: ziaee PR: 190942 Differential Revision: https://reviews.freebsd.org/D49502
* open.2: minor editingKonstantin Belousov2025-03-011-3/+3
| | | | | | | | | Remove unneeded braces. Bump Dd. Suggested and reviewed by: maxim Sponsored by: The FreeBSD Foundation MFC after: 1 week
* open.2: add separate paragraph for O_CREATartembunichev2025-02-281-8/+24
| | | | | PR: 284353 MFC after: 1 week
* recv.2: Improve style in RETURN VALUESAlexander Ziaee2025-02-241-3/+3
| | | | | | | | | Reported by: des MFC after: 3 days Fixes: 571df2c64a3c1 (Explain how recv functions can) Reviewed by: mhorne, des Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48995
* statfs.2: document missing user-visible MNT flagsKonstantin Belousov2025-02-201-0/+18
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* statfs.2: order MNT flags alphabeticallyKonstantin Belousov2025-02-201-43/+43
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* statfs.2: remove dead commentKonstantin Belousov2025-02-201-2/+0
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* statfs.2: uncomment and describe MNT_IGNOREKonstantin Belousov2025-02-201-2/+3
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* libsys: Don't create or expose __realpathatBrooks Davis2025-02-192-1/+1
| | | | | | | | | | | | | | | | Previously, __realpathat was in libc and libsys (as is currently standard), but not exported from libc which meant the stub in libc was not filtered and thus libc's copy of the syscall was used. This broke an upcoming change to CheriBSD limiting syscalls to libsys. The realpath(3) implementation now uses __sys___realpathat so there are no consumers of __realpathat. Switch it to PSEUDO (only _foo and __sys_foo symbols) and remove __realpathat from Symbol.map. This is a corrected version of 58d43a3cd72a4a85ab8489313672c7eab367495e. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49049
* Revert "libsys: Don't create or expose __realpathat"Brooks Davis2025-02-192-1/+1
| | | | | | This change broke RTLD. Revert while I test a fix. This reverts commit fdccf0336197afe59be6f8859177fe2ff8f87fa6.
* libsys: Don't create or expose __realpathatBrooks Davis2025-02-192-1/+1
| | | | | | | | | | | | | | Previously, __realpathat was in libc and libsys (as is currently standard), but not exported from libc which meant the stub in libc was not filtered and thus libc's copy of the syscall was used. This broke an upcoming change to CheriBSD limiting syscalls to libsys. The realpath(3) implementation now uses __sys___realpathat so there are no consumers of __realpathat. Switch it to PSEUDO (only _foo and __sys_foo symbols) and remove __realpathat from Symbol.map. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49049
* recv.2: Explain how recv functions can return 0Felix Johnson2025-02-131-3/+10
| | | | | | | | | | Clarify the RETURN VALUES section with improved structure, the condition of the return value 0, and the setting of errno. PR: 174581 Reviewed by: jhb, ziaee Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48955