$RodHat_

$ man 2 intro

Syscall reference

One card per kernel interface Rod has actually written up: when it landed, whether glibc bothered to wrap it, the flags worth knowing, the errno you'll hit at 2 a.m., and what the BSDs did instead (usually first, usually smaller). Every version number is lifted from the man page cited on the card. If you want the war story, each card links to the full Tip.

Not sure what the box in front of you has? Paste its uname -sr into the kernel check and it'll tell you which of these you can call and what you're missing. Scripts can pull the whole table from /syscalls.json.

42 of 42

cachestat(2)Query page cache status (resident, dirty, writeback, evicted) for a byte range of an open file.6.5
capset(2)Raw syscall to set a thread's permitted, effective and inheritable capability sets.2.2
clone3(2)Fork a child process using a struct-based API; write a pidfd atomically with CLONE_PIDFD.5.3
close_range(2)Close, or mark close-on-exec, every file descriptor in a range in one call.5.9
copy_file_range(2)Copy a range of bytes between two file descriptors entirely inside the kernel, with server-side offload on NFS 4.2 and reflink on btrfs.4.5
eventfd(2)Create a kernel-backed 64-bit counter fd for wakeups between threads or processes.2.6.22
fanotify_init(2)Create an fanotify group: VFS-level file access events with live fds and blockable opens.2.6.37
flock(2)Apply or remove an advisory whole-file lock tied to an open file description.4.2BSD; Linux 2.0
fsopen(2)Open a filesystem context: step one of the fd-based mount API (fsconfig, fsmount, move_mount).5.2
futex(2)Fast userspace locking: wait on or wake threads sleeping on a 32-bit word in memory.2.6.0
getrandom(2)Fill a buffer with random bytes from the kernel CSPRNG, without opening /dev/urandom.3.17
io_uring_setup(2)Create an io_uring instance: shared submission/completion rings for async I/O.5.1
ioprio_set(2)Set a thread's I/O scheduling class and priority (ionice is the CLI wrapper).2.6.13
jail(2)Create a FreeBSD jail and lock the current process into it (jail_set/jail_attach for more).FreeBSD 4.0
keyctl(2)Manipulate the kernel key retention service: read, revoke, time out and link keys and keyrings.2.6.10
landlock_create_ruleset(2)Create a Landlock ruleset fd, step one of unprivileged filesystem/network sandboxing.5.13
madvise(2)Advise the kernel how a memory range will be used: free it, page it out, exclude it from dumps.4.4BSD
memfd_create(2)Create an anonymous RAM-backed file with no path, optionally sealable.3.17
memfd_secret(2)Create memory removed from the kernel's direct map, mapped only by fd holders.5.14
mlock(2)Lock pages into RAM so they can't be swapped out; mlockall() does the whole address space.POSIX.1-1996 (SVr4)
openat2(2)Open a file with kernel-enforced path-resolution constraints (RESOLVE_* flags).5.6
pidfd_getfd(2)Duplicate a file descriptor out of another process, addressed by its pidfd.5.6
pidfd_open(2)Get a file descriptor that refers to a process, immune to PID reuse.5.3
pidfd_send_signal(2)Send a signal to the process a pidfd refers to, without PID-reuse races.5.1
pkey_alloc / pkey_mprotect(2)Allocate a memory protection key and use it to gate access to a memory region via a per-thread register, without a syscall per permission switch.4.8
pledge(2)Restrict the process to named groups of system operations; violations kill it with SIGABRT.OpenBSD 5.9
prctl(2)Per-process/thread control knobs: no_new_privs, dumpable, parent-death signal, VMA names and more.2.1.57
process_madvise(2)madvise() for another process's address space, addressed by pidfd and an iovec of ranges.5.10
rseq(2)Register a per-thread struct that the kernel keeps updated with the current CPU ID, enabling lock-free per-CPU data updates via restartable critical sections.4.18
sched_setaffinity(2)Set the set of CPUs a thread may run on (taskset is the CLI wrapper).2.5.8
SCM_RIGHTSPass open file descriptors to another process over a UNIX domain socket.unknown
seccomp(2)Set the thread's seccomp state: strict mode or a BPF filter on every syscall.3.17
setns(2)Move the calling thread into an existing namespace, given an fd for it (or a pidfd).3.0
signalfd(2)Accept signals by reading a file descriptor instead of running a handler.2.6.22
SO_REUSEPORTLet multiple sockets bind one address:port; the kernel spreads traffic across them.3.9
splice(2)Move data between a pipe and another fd without copying through userspace.2.6.17
statx(2)Extended stat: request specific fields, get birth time, inode attribute flags and mount ID.4.11
tee(2)Duplicate data from one pipe into another without consuming it from the source.2.6.17
timerfd_create(2)Create a timer that reports expirations through a readable file descriptor.2.6.25
unshare(2)Create new namespaces and move the calling process into them without forking.2.6.16
unveil(2)Hide the whole filesystem except the paths you name, with per-path r/w/x/c permissions.OpenBSD 6.4
userfaultfd(2)Create an fd that lets userspace resolve page faults on registered memory ranges.4.3

"Since" is the Linux kernel release unless the row says otherwise. For the full arguments behind each card, see Rod's Tips From the Console.