summaryrefslogtreecommitdiff
path: root/lib/libsys/Makefile.sys
AgeCommit message (Collapse)Author
2025-11-06libsys: install manpage links for jail_attach_jd/jail_remove_jdChristian S.J. Peron
This was a minor oversight from their introduction. Commit message by kevans@. Fixes: 851dc7f859c23 ("jail: add jail descriptors") Reviewed by: kevans
2025-11-04kexec: Add basic kexec_load man pageJustin Hibbits
Also add kexec reboot flag to the reboot man page.
2025-08-08syscalls: normalize _exit(2) declerationsBrooks Davis
exit(3) is implemented by the runtime and performs a number of shutdown actions before ultimately calling _exit(2) to terminate the program. We historically named the syscall table entry `exit` rather than `_exit`, but this requires special handling in libc/libsys to cause the `_exit` symbol to exist while implementing `exit` in libc. Declare the syscall as `_exit` and flow that through the system. Because syscall(SYS_exit, code) is fairly widely used, allow a configured extra line in syscall.h to define SYS_exit to SYS__exit. I've found no external uses of __sys_exit() so I've not bothered to create a compatability version of this private symbol. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D51672
2025-08-06libsys: add a dependency for syscall stubsBrooks Davis
Make syscall stubs generated by lib/libsys/Makefile.sys depend on it. This will have some false positives, but generating and assembling them is fast. Also add slightly dubious dependencies on compat.h and SYS.h. While here, fix the comment documenting the assembly origin. Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D51671
2025-07-04inotify: Add man pages for the new syscalls and for VOP_INOTIFYMark Johnston
Reviewed by: kib MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50315
2025-02-19libsys: Don't create or expose __realpathatBrooks Davis
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
2025-02-19Revert "libsys: Don't create or expose __realpathat"Brooks Davis
This change broke RTLD. Revert while I test a fix. This reverts commit fdccf0336197afe59be6f8859177fe2ff8f87fa6.
2025-02-19libsys: Don't create or expose __realpathatBrooks Davis
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
2024-12-30kqueue.2: Editorial passJohn Baldwin
- Use consistent language to describe user values unchanged by the kernel. - Replace passive language with active in a few places. - Add a history note for kqueuex() and kqueue1(). - Add an MLINK and synopsis for kqueue1(). - Various wording and markup tweaks. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48203
2024-12-19setcred(2): Add manual pageOlivier Certner
Reviewed by: Alexander Ziaee <concussious@runbox.com> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48063
2024-11-29Add fchroot(2)Edward Tomasz Napierala
This is similar to chroot(2), but takes a file descriptor instead of path. Same syscall exists in NetBSD and Solaris. It is part of a larger patch to make absolute pathnames usable in Capsicum mode, but should be useful in other contexts too. Reviewed By: brooks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D41564
2024-11-13sched_getcpu: Add man pageEd Maste
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47556
2024-11-01libsys: remove yield special caseBrooks Davis
Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1503
2024-10-07libsys: connect membarrier.2Ed Maste
Sponsored by: The FreeBSD Foundation
2024-10-07getrlimitusage.2: add the man pageKonstantin Belousov
Reviewed by: olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46823
2024-10-04lib{c,sys}: .note.GNU-stack in syscall stubsBrooks Davis
Explicitly disable executable stacks in the syscall stubs on all architectures. Previously, aarch64 and riscv64 didn't include the .note.GNU-stack note due it being disabled by default in those ABIs. This appears to have been harmless in practice, but better to be clear in case a different compiler/linker has different defaults. This also reduces special cases in the Makefile. Reported by: jrtc27 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44883
2024-08-03libsys: Add MLINKs for recvmmsg.2 and sendmmsg.2John Baldwin
These were accidentally lost when moving recvmmsg and sendmmsg back from libc to libsys. Reported by: Mark Millard <marklmi@yahoo.com> Reviewed by: brooks, imp Fixes: 29d079c96491 libsys: move __libsys_interposer consumers Differential Revision: https://reviews.freebsd.org/D46200
2024-04-22Make __libsys_interposing_slot libsys onlyBrooks Davis
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44881
2024-03-13lib{c,sys}: return wrapped syscall APIs to libcBrooks Davis
These provide standard APIs, but are implemented using another system call (e.g., pipe implemented in terms of pipe2) or are interposed by the threading library to support cancelation. After discussion with kib (see D44111), I've concluded that it is better to keep most public interfaces in libc with as little as possible in libsys. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44241
2024-03-13libsys: don't expose sigwait wrapperBrooks Davis
Long ago (e129c18a83ef) __sys_sigwait was wrapped to prevent sigwait() from returning with EINTR. Through a series of changes this wrapper become __libc_sigwait which was internal to libc and used solely in the interposing table. To support a move of sigwait back to libc, move this wrapper into libsys and rename it with an __libsys_ prefix. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44238
2024-03-07libsys/aarch64: end syscall stubs with newlinesBrooks Davis
Technically speaking, POSIX text files must end with a newline. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44231
2024-02-29libsys: make PSEUDO take a bare syscall nameBrooks Davis
Rather than having PSEUDO be a list of object files when all consumers want syscall names or source files, make it a list of bare syscall names like INTERPOSED (which is built on PSEUDO). Improve document of variables developers can set. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44108
2024-02-29libsys: consolidate PSEUDO definitionsBrooks Davis
Consolidate in preparation for further cleanup. Also relocate the sole NOASM entry. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44107
2024-02-29libsys: reduce makefile declaration duplicationBrooks Davis
Every PSEUDO entry (_foo.o) has a corresponding NOASM entry (foo.o) to suppress its addition to ASM. Check PSEUDO instead when adding entries to ASM. No functional change. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44106
2024-02-23libsys: fix sleep(3)/usleep(3) cancel behaviorKonstantin Belousov
Move functions back to libc/gen sources; they are only versioned from libc and not libsys. Access libsys interposing slots using __libsys_interposing_slot() instead of direct __libsys_interposing array dereference, which cannot work from libc. Reported by: glebius Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D44042
2024-02-21libsys: remove usage of pthread_once and _once_stubKonstantin Belousov
that existed in auxv.c, use simple bool gate instead. This leaves a small window if two threads try to call _elf_aux_info(3) simultaneously. The situation is safe because auxv parsing is really idempotent. The parsed data is the same, and we store atomic types (int/long/ptr) so double-init does not matter. Reviewed by: brooks, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D43985
2024-02-19lib{c,sys}: move auxargs more firmly into libsysBrooks Davis
Continue to filter the public interface (elf_aux_info()), but entierly relocate the private interfaces (_elf_aux_info(), __init_elf_aux_vector(), and __elf_aux_vector) to libsys. This ensures that rtld updates the correct (only) copy of __elf_aux_vector. After 968a18975adc9c2a619bb52aa2f009de99fc9e24 updates were confused and __getosreldate was failing, causing the system to fall back to compat compat12 syscalls in some cases. Return to explicitly linking libc to libsys and link libthr with libc and libsys (in that order). Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D43910
2024-02-11Document aio_read2/aio_write2Konstantin Belousov
Reviewed by: jhb Discussed with: asomers Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43448
2024-02-05libsys: plumb in to buildBrooks Davis
libsys provides the FreeBSD kernel interface (auxargs, system calls, vdso). It can be linked directly for programs using a non-standard libc and will later be linked as a filter library to libc providing the actual system call implementation. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libsys: generate private symbol mapBrooks Davis
We now export all _ and __sys_ prefixed syscalls stubs from libc and libsys so that libsys can replace them. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: move __getosreldate to libsysBrooks Davis
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: move getpagesize(s) to libsysBrooks Davis
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: elf auxiliary vector handling to libsysBrooks Davis
This is part of the interface to the kernel and some syscall wrappers depend on it so move it there. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: compile _once in libsysBrooks Davis
auxv support requires _once(), but we don't want the libsys version stomping on the libc version should they diverge in the future. We could rename it entierly, but for now just hook it in via Makefile.sys. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: move MD sys related symbols to libsysBrooks Davis
This is a mix genuine MD interfaces and compat symbols like _getlogin. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: move rfork_thread(3) to libsysBrooks Davis
rfork_thread(3) is assembly that makes syscalls directly and uses cerror so it belongs in libsys. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: Move per-arch sys/Makefile.inc to libsysBrooks Davis
libc/<arch>/sys/Makefile.inc -> libsys/<arch>/Makefile.sys. Require that libsys/<arch>/Makefile.sys exist. At least for current archtiectures, it's not possible for an architecture to not have and MD syscall bits. powerpcspe/Makefile.sys's structure means it had to be modified when moved so rename detection won't work, but it has trivial contents so the history is unimportant. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: remove .PATH refs to libc/<arch>/sysBrooks Davis
There are no longer any source files here so remove references. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libsys: move __libsys_interposer consumersBrooks Davis
These system call wrappers call interposed system calls in fairly trivial ways. Move them over to libsys so all __libsys_interposer consumers end up in libsys. Also move recvmmsg and sendmmsg as they are documented with recv and send. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
2024-02-05libc: libc/sys/Makefile.inc -> libsys/Makefile.sysBrooks Davis
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908