Linux System Calls Reference

Common Linux syscalls with number, signature, errno and man-page reference.

Searchable Linux x86-64 system call reference covering process, file, memory, network and signal syscalls with their syscall number, C signature, return value and category.

Are these syscall numbers the same on every architecture?

No. The numbers shown are for x86-64 (the values in the rax register). Other architectures such as ARM64, x86 (32-bit) and RISC-V use different syscall numbers, though the names and semantics are largely shared. Always check the per-arch table for portable code.

Linux system calls, the kernel boundary

Every time a program reads a file, allocates memory, spawns a process or opens a socket, it crosses from user space into the kernel through a system call. On x86-64, the syscall number goes in the rax register, arguments in rdi, rsi, rdx, r10, r8, r9, and the syscall instruction transfers control to the kernel. This reference lists the most common syscalls with their number, C signature and category so you can decode an strace log or write inline assembly without leaving the page.

How it works

A syscall is dispatched by number. The kernel’s syscall table maps rax to a handler, the handler runs in kernel mode, and the result comes back in rax. At the raw level a return value in the range -4095 to -1 is a negated errno — the glibc wrapper detects this, returns -1 and sets errno to the positive code. Successful calls return a non-negative value: a count of bytes, a new file descriptor, a pointer (from mmap), or 0.

Syscalls group into families. Process calls (fork, clone, execve, exit_group, wait4) manage the process lifecycle. File calls (open/openat, read, write, close, lseek, stat) move data through file descriptors. Memory calls (mmap, munmap, mprotect, brk) manage the address space. Network calls (socket, bind, listen, accept, connect, sendto, recvfrom) drive sockets. Signal calls (kill, rt_sigaction, rt_sigprocmask) deliver and handle asynchronous notifications.

Tips and examples

  • Prefer the *at variants (openat, unlinkat, fstatat) for race-free path resolution relative to a directory file descriptor.
  • strace -c ./prog gives a histogram of which syscalls dominate — useful when a program feels slow or chatty.
  • The numbers here are x86-64 specific. The canonical table lives at arch/x86/entry/syscalls/syscall_64.tbl in the kernel source.