$RodHat_/search

$ 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. Browse the flags and arguments index or the errno reference if you already know the name. Scripts can pull the whole table from /syscalls.json.

58 of 58

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
execveat(2)Execute a program via file descriptor instead of path, eliminating the TOCTOU race between verify and exec.3.19
fallocate(2)Allocate disk space, punch holes, collapse or insert byte ranges in a file.2.6.23
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
inotify_add_watch(2)Watch a file or directory for filesystem events and read them off a file descriptor.2.6.13
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
kcmp(2)Compare whether two resources in different processes refer to the same kernel object.3.5
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
membarrier(2)Issue a memory barrier across all threads in the calling process, offloading the barrier cost from readers to the writer.4.3
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)
mount_setattr(2)Change VFS-layer mount attributes on an existing mount or subtree, optionally recursing.5.12
mseal(2)Permanently seal a virtual memory area against mprotect, munmap, and MAP_FIXED remapping.6.10
name_to_handle_at / open_by_handle_at(2)Get a stable opaque file handle for a path and reopen it later, surviving remounts and bind-mount rearrangement.2.6.39
openat2(2)Open a file with kernel-enforced path-resolution constraints (RESOLVE_* flags).5.6
perf_event_open(2)Open a file descriptor for a hardware or software performance counter.2.6.31
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
posix_fadvise(2)Declare the expected access pattern for a file region so the kernel can tune readahead and page-cache reclaim.2.5.60
prctl(2)Per-process/thread control knobs: no_new_privs, dumpable, parent-death signal, VMA names and more.2.1.57
preadv2 / pwritev2(2)Scatter/gather I/O at an offset with per-call flags: RWF_NOWAIT, RWF_HIPRI, RWF_DSYNC, RWF_SYNC, RWF_APPEND.4.6
process_madvise(2)madvise() for another process's address space, addressed by pidfd and an iovec of ranges.5.10
process_vm_readv(2)Read from or write to another process's virtual address space in one syscall, without attaching via ptrace.3.2
renameat2(2)Rename or atomically swap two filesystem entries, with optional no-overwrite and exchange flags.3.15
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
sched_setattr(2)Set scheduling policy and attributes for a thread, including SCHED_DEADLINE runtime/deadline/period reservations.3.14
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
sync_file_range(2)Submits async writeback for a byte range and optionally waits for it, without syncing inode metadata. Lets sequential writers overlap I/O with compute while deferring the durability-barrier fdatasync to checkpoint time.2.6.17
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
vmsplice(2)Splice user-space pages directly into a pipe; with SPLICE_F_GIFT the kernel takes ownership of those pages without copying.2.6.17

"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.