411 REFERENCE · Wikibooks
The Linux Kernel/Syscalls
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
__NOTOC__
Linux kernel system calls
as exported by glibc, all on one sheet
System
sys/ioctl.h:
ioctl
sys/random.h:
getrandom
pci.h:
pciconfig_read
pciconfig_write
linux/sysctl.h:
sysctl
linux/membarrier.h:
membarrier
sys/klog.h:
syslog
linux/bpf.h:
bpf
grp.h:
setgroups
sys/utsname.h:
uname
linux/getcpu.h:
getcpu
sys/sysinfo.h:
sysinfo
sys/personality.h:
personality
sys/ptrace.h:
ptrace
linux/kexec.h:
kexec_file_load
kexec_load
linux/reboot.h:
reboot
Unexported:
delete_module
init_module
finit_module
perf_event_open
rseq Time
sys/time.h:
futimesat
utimes
gettimeofday
settimeofday
getitimer, setitimer
time.h:
clock_settime
clock_gettime
clock_getres
clock_nanosleep
time
stime
nanosleep
posix-timers.c:
timer_create
timer_gettime
timer_getoverrun
timer_settime
timer_delete
sys/timerfd.h:
timerfd_create
timerfd_settime
timerfd_gettime
sys/eventfd.h:
eventfd2
eventfd
utime.h:
utime
sys/times.h:
times
bits/time.h:
clock_adjtime
sys/timex.h:
adjtimex Processes
unistd.h:
fork, vfork
brk
getpid, getppid, getpgrp
uselib
execve, execveat
nice
getgroups
getgid, setgid
getuid, setuid
getresuid, setresuid
getresgid, setresgid
getsid, setsid
setpgid, getpgid
getegid, geteuid
setreuid, setregid
pause
alarm
acct
sys/prctl.h:
prctl
sched.h:
clone
sched_setscheduler
sched_setparam
sched_setattr
sched_getscheduler
sched_getparam
sched_getattr
sched_setaffinity
sched_getaffinity
sched_yield
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
unshare
setns
linux/unistd.h:
set_tid_address
exit_group
sys/resource.h:
setpriority, getpriority
getrlimit setrlimit
getrusage
gettid
linux/kcmp.h:
kcmp
sys/capability.h:
capget, capset
stdlib.h:
exit Synchronization
sys/sem.h:
semget
semctl
semtimedop
semop
mqueue.h:
mq_open
mq_unlink
mq_timedsend
mq_timedreceive
mq_notify
sys/msg.h:
msgget
msgctl
msgsnd
msgrcv
sys/wait.h:
waitid
wait4
waitpid
sys/signalfd.h:
signalfd4
signalfd
signal.h:
kill
sigtimedwait
sigaltstack
sigpending
sigprocmask
sigaction
signal
sigsuspend
Unexported:
futex
set_robust_list
get_robust_list
restart_syscall
tgkill
rt_sigqueueinfo
rt_tgsigqueueinfo
mq_getsetattr
Memory
numaif.h:
mbind
set_mempolicy
migrate_pages
get_mempolicy
numaif.h:
move_pages
sys/mman.h:
msync
mincore
munmap
remap_file_pages
mremap
mlock, mlock2
munlockmlockall
munlockall
mprotect
pkey_mprotect
pkey_alloc
pkey_free
madvise
sys/shm.h:
shmget, shmctl
shmat, shmdt
sys/swap.h:
swapoff, swapon
sys/memfd.h:
memfd_create
Security
sys/fsuid.h:
setfsuid
setfsgid
keyutils.h:
add_key
request_key
keyctl
Unexported:
seccomp Metadata
sys/stat.h:
stat
sys/statfs.h:
statfs
fstatfs
sys/inotify.h:
inotify_init1
inotify_init
inotify_add_watch
inotify_rm_watch
sys/fanotify.h:
fanotify_init
fanotify_mark
sys/xattr.h:
setxattr
lsetxattr
fsetxattr
getxattr
lgetxattr
fgetxattr
listxattr
llistxattr
flistxattr
removexattr
lremovexattr
fremovexattr
sys/quota.h:
quotactl
stdio.h:
renameat
rename
Unexported:
statx
io_getevents
io_pgetevents
fsopen
fspick
lookup_dcookie
renameat2
fsinfo
open_tree
fsmount
move_mount
pivot_root
getdents
vmsplice
name_to_handle_at
open_by_handle_at
pselect6
userfaultfd
mmap_pgoff
ioprio_set
ioprio_get Data
fcntl.h:
open, openat
fcntl
sync_file_range
fallocate
creat
splice
tee
readahead
unistd.h:
truncate, ftruncate
faccessat, access
fchdir, chdir
chroot
fchownat, chown
lchown, fchown
close
vhangup
pipe, pipe2
sync, syncfs
fsync, fdatasync
dup, dup2, dup3
lseek
read, write
copy_file_range
sys/uio.h:
readv, writev
preadv, pwritev
preadv2, pwritev2
process_vm_readv
process_vm_writev
sys/file.h:
flock
sys/mount.h:
mount, umount
Nonblocking IO
sys/epoll.h:
epoll_create1
epoll_create
epoll_ctl
epoll_wait
epoll_pwait
sys/select.h:
select
poll.h:
poll, ppoll
linux/aio_abi.h:
io_setup
io_destroy
io_submit
io_cancel Network
sys/socket.h:
socket, socketpair
bind
listen
accept, accept4
connect
getsockname
getpeername
send, recv
sendto, recvfrom
setsockopt, getsockopt
shutdown
sendmsg, sendmmsg
recvmsg, recvmmsg
linux/net.h:
socketcall
sys/sendfile.h:
sendfile
unistd.h:
sethostname
gethostname
setdomainname
Obsolete:
ipc, sgetmask, ssetmask, sysfs
Descriptions
acceptaccept, accept4accept4 - accept a connection on a socket
accessaccess, faccessatfaccessat - check user's permissions for a file
acctacct - switch process accounting on or off
add_keyadd_key - add a key to the kernel's key management facility
adjtimexadjtimex, ntp_adjtimentp_adjtime - tune kernel clock
afs_syscall, break, fattach, fdetach, ftime, getmsg, getpmsg, gtty, isastream, lock, madvise1, mpx, prof, profil, putmsg, putpmsg, security, stty, tuxcall, ulimit, vserver - unimplemented system calls
alarmalarm - set an alarm clock for delivery of a signal
alloc_hugepagesalloc_hugepages, free_hugepagesfree_hugepages - allocate or free huge pages
arch_prctlarch_prctl - set architecture-specific thread state
bdflushbdflush - start, flush, or tune buffer-dirty-flush daemon
bindbind - bind a name to a socket
bpfbpf - perform a command on an extended BPF map or program
brkbrk, sbrksbrk - change data segment size
cacheflushcacheflush - flush contents of instruction and/or data cache
capgetcapget, capsetcapset - set/get capabilities of thread(s)
chdirchdir, fchdirfchdir - change working directory
chmodchmod, fchmod, fchmodatfchmodat - change permissions of a file
chownchown, fchown, lchown, fchownatfchownat - change ownership of a file
chrootchroot - change root directory
clock_getresclock_getres, clock_gettime, clock_settimeclock_settime - clock and time functions
clock_nanosleepclock_nanosleep - high-resolution sleep with specifiable clock
cloneclone, __clone2__clone2 - create a child process
closeclose - close a file descriptor
connectconnect - initiate a connection on a socket
copy_file_rangecopy_file_range - Copy a range of data from one file to another
create_modulecreate_module - create a loadable module entry
delete_moduledelete_module - unload a kernel module
dupdup, dup2, dup3dup3 - duplicate a file descriptor
epoll_createepoll_create, epoll_create1epoll_create1 - open an epoll file descriptor
epoll_ctlepoll_ctl - control interface for an epoll file descriptor
epoll_waitepoll_wait, epoll_pwaitepoll_pwait - wait for an I/O event on an epoll file descriptor
eventfdeventfd - create a file descriptor for event notification
execveatexecveat - execute program relative to a directory file descriptor
execveexecve - execute program
_exit_exit, _Exit_Exit - terminate the calling process
exit_groupexit_group - exit all threads in a process
fallocatefallocate - manipulate file space
fanotify_initfanotify_init - create and initialize fanotify group
fanotify_markfanotify_mark - add, remove, or modify an fanotify mark on a filesystem object
fcntlfcntl - manipulate file descriptor
flockflock - apply or remove an advisory lock on an open file
forkfork - create a child process
fsyncfsync, fdatasyncfdatasync - synchronize a file's in-core state with storage device
futexfutex - fast user-space locking
futimesatfutimesat - change timestamps of a file relative to a directory file descriptor
getcontextgetcontext, setcontextsetcontext - get or set the user context
getcpugetcpu - determine CPU and NUMA node on which the calling thread is running
getcwdgetcwd, getwd, get_current_dir_nameget_current_dir_name - get current working directory
getdentsgetdents, getdents64getdents64 - get directory entries
getdomainnamegetdomainname, setdomainnamesetdomainname - get/set NIS domain name
getdtablesizegetdtablesize - get file descriptor table size
getgidgetgid, getegidgetegid - get group identity
getgroupsgetgroups, setgroupssetgroups - get/set list of supplementary group IDs
gethostidgethostid, sethostidsethostid - get or set the unique identifier of the current host
gethostnamegethostname, sethostnamesethostname - get/set hostname
getitimergetitimer, setitimersetitimer - get or set value of an interval timer
get_kernel_symsget_kernel_syms - retrieve exported kernel and module symbols
get_mempolicyget_mempolicy - retrieve NUMA memory policy for a thread
getpagesizegetpagesize - get memory page size
getpeernamegetpeername - get name of connected peer socket
getpidgetpid, getppidgetppid - get process identification
getprioritygetpriority, setprioritysetpriority - get/set program scheduling priority
getrandomgetrandom - obtain a series of random bytes
getresuidgetresuid, getresgidgetresgid - get real, effective and saved user/group IDs
getrlimitgetrlimit, setrlimit, prlimitprlimit - get/set resource limits
get_robust_listget_robust_list, set_robust_listset_robust_list - get/set list of robust futexes
getrusagegetrusage - get resource usage
getsidgetsid - get session ID
getsocknamegetsockname - get socket name
getsockoptgetsockopt, setsockoptsetsockopt - get and set options on sockets
get_thread_areaget_thread_area, set_thread_areaset_thread_area - set a GDT entry for thread-local storage
gettidgettid - get thread identification
gettimeofdaygettimeofday, settimeofdaysettimeofday - get / set time
getuidgetuid, geteuidgeteuid - get user identity
getunwindgetunwind - copy the unwind data to caller's buffer
idleidle - make process 0 idle
init_moduleinit_module, finit_modulefinit_module - load a kernel module
inotify_add_watchinotify_add_watch - add a watch to an initialized inotify instance
inotify_initinotify_init, inotify_init1inotify_init1 - initialize an inotify instance
inotify_rm_watchinotify_rm_watch - remove an existing watch from an inotify instance
introintro - introduction to system calls
io_cancelio_cancel - cancel an outstanding asynchronous I/O operation
ioctl_consoleioctl_console - ioctls for console terminal and virtual consoles
ioctlioctl - control device
ioctl_fatioctl_fat - manipulating the FAT filesystem
ioctl_ficlonerangeioctl_ficlonerange, ioctl_ficloneioctl_ficlone - share some the data of one file with another file
ioctl_fideduperangeioctl_fideduperange - share some the data of one file with another file
ioctl_getfsmapioctl_getfsmap - retrieve the physical layout of the filesystem
ioctl_iflagsioctl_iflags - ioctl() operations for inode flags
ioctl_listioctl_list - list of ioctl calls in Linux/i386 kernel
ioctl_nsioctl_ns - ioctl() operations for Linux namespaces
ioctl_ttyioctl_tty - ioctls for terminals and serial lines
ioctl_userfaultfdioctl_userfaultfd - create a file descriptor for handling page faults in user space
io_destroyio_destroy - destroy an asynchronous I/O context
io_geteventsio_getevents - read asynchronous I/O events from the completion queue
iopermioperm - set port input/output permissions
iopliopl - change I/O privilege level
ioprio_getioprio_get, ioprio_setioprio_set - get/set I/O scheduling class and priority
io_setupio_setup - create an asynchronous I/O context
io_submitio_submit - submit asynchronous I/O blocks for processing
ipcipc - System V IPC system calls
kcmpkcmp - compare two processes to determine if they share a kernel resource
kexec_loadkexec_load, kexec_file_loadkexec_file_load - load a new kernel for later execution
keyctlkeyctl - manipulate the kernel's key management facility
killpgkillpg - send signal to a process group
killkill - send signal to a process
linklink, linkatlinkat - make a new name for a file
listenlisten - listen for connections on a socket
_llseek_llseek - reposition read/write file offset
lookup_dcookielookup_dcookie - return a directory entry's path
lseeklseek - reposition read/write file offset
madvisemadvise - give advice about use of memory
mbindmbind - set memory policy for a memory range
membarriermembarrier - issue memory barriers on a set of threads
memfd_creatememfd_create - create an anonymous file
migrate_pagesmigrate_pages - move all pages in a process to another set of nodes
mincoremincore - determine whether pages are resident in memory
mkdirmkdir, mkdiratmkdirat - create a directory
mknodmknod, mknodatmknodat - create a special or ordinary file
mlockmlock, mlock2, munlock, mlockall, munlockallmunlockall - lock and unlock memory
mmap2mmap2 - map files or devices into memory
mmapmmap, munmapmunmap - map or unmap files or devices into memory
modify_ldtmodify_ldt - get or set a per-process LDT entry
mountmount - mount filesystem
move_pagesmove_pages - move individual pages of a process to another node
mprotectmprotect, pkey_mprotectpkey_mprotect - set protection on a region of memory
mq_getsetattrmq_getsetattr - get/set message queue attributes
mq_notifymq_notify - register for notification when a message is available
mq_openmq_open - open a message queue
mq_receivemq_receive, mq_timedreceivemq_timedreceive - receive a message from a message queue
mq_sendmq_send, mq_timedsendmq_timedsend - send a message to a message queue
mq_unlinkmq_unlink - remove a message queue
mremapmremap - remap a virtual memory address
msgctlmsgctl - System V message control operations
msggetmsgget - get a System V message queue identifier
msgrcvmsgrcv, msgsndmsgsnd - System V message queue operations
msyncmsync - synchronize a file with a memory map
name_to_handle_atname_to_handle_at, open_by_handle_atopen_by_handle_at - obtain handle for a pathname and open file via a handle
nanosleepnanosleep - high-resolution sleep
nfsservctlnfsservctl - syscall interface to kernel nfs daemon
nicenice - change process priority
openopen, openat, creatcreat - open and possibly create a file
outboutb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, outb_p, outw_p, outl_p, inb_p, inw_p, inl_pinl_p - port I/O
pausepause - wait for signal
pciconfig_readpciconfig_read, pciconfig_write, pciconfig_iobasepciconfig_iobase - pci device information handling
perf_event_openperf_event_open - set up performance monitoring
perfmonctlperfmonctl - interface to IA-64 performance monitoring unit
personalitypersonality - set the process execution domain
pipepipe, pipe2pipe2 - create pipe
pivot_rootpivot_root - change the root filesystem
pkey_allocpkey_alloc, pkey_freepkey_free - allocate or free a protection key
pollpoll, ppollppoll - wait for some event on a file descriptor
posix_fadviseposix_fadvise - predeclare an access pattern for file data
prctlprctl - operations on a process
preadpread, pwritepwrite - read from or write to a file descriptor at a given offset
process_vm_readvprocess_vm_readv, process_vm_writevprocess_vm_writev - transfer data between process address spaces
ptraceptrace - process trace
query_modulequery_module - query the kernel for various bits pertaining to modules
quotactlquotactl - manipulate disk quotas
readaheadreadahead - initiate file readahead into page cache
readdirreaddir - read directory entry
readlinkreadlink, readlinkatreadlinkat - read value of a symbolic link
readread - read from a file descriptor
readvreadv, writev, preadv, pwritev, preadv2, pwritev2pwritev2 - read or write data into multiple buffers
rebootreboot - reboot or enable/disable Ctrl-Alt-Del
recvmmsgrecvmmsg - receive multiple messages on a socket
recvrecv, recvfrom, recvmsgrecvmsg - receive a message from a socket
remap_file_pagesremap_file_pages - create a nonlinear file mapping
renamerename, renameat, renameat2renameat2 - change the name or location of a file
request_keyrequest_key - request a key from the kernel's key management facility
restart_syscallrestart_syscall - restart a system call after interruption by a stop signal
rmdirrmdir - delete a directory
rt_sigqueueinfort_sigqueueinfo, rt_tgsigqueueinfort_tgsigqueueinfo - queue a signal and data
s390_pci_mmio_writes390_pci_mmio_write, s390_pci_mmio_reads390_pci_mmio_read - transfer data to/from PCI MMIO memory page
s390_runtime_instrs390_runtime_instr - enable/disable s390 CPU run-time instrumentation
s390_sthyis390_sthyi - emulate STHYI instruction
sched_get_priority_maxsched_get_priority_max, sched_get_priority_min - get static priority range
sched_rr_get_intervalsched_rr_get_interval - get the SCHED_RR interval for the named process
sched_setaffinitysched_setaffinity, sched_getaffinitysched_getaffinity - set and get a thread's CPU affinity mask
sched_setattrsched_setattr, sched_getattrsched_getattr - set and get scheduling policy and attributes
sched_setparamsched_setparam, sched_getparamsched_getparam - set and get scheduling parameters
sched_setschedulersched_setscheduler, sched_getschedulersched_getscheduler - set and get scheduling policy/parameters
sched_yieldsched_yield - yield the processor
seccompseccomp - operate on Secure Computing state of the process
selectselect, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZEROFD_ZERO - synchronous I/O multiplexing
semctlsemctl - System V semaphore control operations
semgetsemget - get a System V semaphore set identifier
semopsemop, semtimedopsemtimedop - System V semaphore operations
sendfilesendfile - transfer data between file descriptors
sendmmsgsendmmsg - send multiple messages on a socket
sendsend, sendto, sendmsgsendmsg - send a message on a socket
seteuidseteuid, setegidsetegid - set effective user or group ID
setfsgidsetfsgid - set group identity used for filesystem checks
setfsuidsetfsuid - set user identity used for filesystem checks
setgidsetgid - set group identity
set_mempolicyset_mempolicy - set default NUMA memory policy for a thread and its children
setnssetns - reassociate thread with a namespace
setpgidsetpgid, getpgid, setpgrp, getpgrpgetpgrp - set/get process group
setresuidsetresuid, setresgidsetresgid - set real, effective and saved user or group ID
setreuidsetreuid, setregidsetregid - set real and/or effective user or group ID
setsidsetsid - creates a session and sets the process group ID
set_tid_addressset_tid_address - set pointer to thread ID
setuidsetuid - set user identity
setupsetup - setup devices and filesystems, mount root filesystem
sgetmasksgetmask, ssetmaskssetmask - manipulation of signal mask (obsolete)
shmatshmat, shmdtshmdt - System V shared memory operations
shmctlshmctl - System V shared memory control
shmgetshmget - allocates a System V shared memory segment
shutdownshutdown - shut down part of a full-duplex connection
sigactionsigaction, rt_sigactionrt_sigaction - examine and change a signal action
sigaltstacksigaltstack - set and/or get signal stack context
signalsignal - ANSI C signal handling
signalfdsignalfd - create a file descriptor for accepting signals
sigpendingsigpending, rt_sigpendingrt_sigpending - examine pending signals
sigprocmasksigprocmask, rt_sigprocmaskrt_sigprocmask - examine and change blocked signals
sigqueuesigqueue - queue a signal and data to a process
sigreturnsigreturn, rt_sigreturnrt_sigreturn - return from signal handler and cleanup stack frame
sigsuspendsigsuspend, rt_sigsuspendrt_sigsuspend - wait for a signal
sigwaitinfosigwaitinfo, sigtimedwait, rt_sigtimedwaitrt_sigtimedwait - synchronously wait for queued signals
socketcallsocketcall - socket system calls
socketsocket - create an endpoint for communication
socketpairsocketpair - create a pair of connected sockets
splicesplice - splice data to/from a pipe
spu_createspu_create - create a new spu context
spu_runspu_run - execute an SPU context
statfsstatfs, fstatfsfstatfs - get filesystem statistics
statstat, fstat, lstat, fstatatfstatat - get file status
statvfsstatvfs, fstatvfsfstatvfs - get filesystem statistics
statxstatx - get file status (extended)
stimestime - set time
subpage_protsubpage_prot - define a subpage protection for an address range
swaponswapon, swapoffswapoff - start/stop swapping to file/device
symlinksymlink, symlinkatsymlinkat - make a new name for a file
sync_file_rangesync_file_range - sync a file segment with disk
syncsync, syncfssyncfs - commit filesystem caches to disk
syscallsyscall - indirect system call
_syscall_syscall - invoking a system call without library support (OBSOLETE)
syscallssyscalls - Linux system calls
sysctlsysctl - read/write system parameters
sysfssysfs - get filesystem type information
sysinfosysinfo - return system information
syslogsyslog, klogctlklogctl - read and/or clear kernel message ring buffer; set console_loglevel
teetee - duplicating pipe content
timetime - get time in seconds
timer_createtimer_create - create a POSIX per-process timer
timer_deletetimer_delete - delete a POSIX per-process timer
timerfd_createtimerfd_create, timerfd_settime, timerfd_gettimetimerfd_gettime - timers that notify via file descriptors
timer_getoverruntimer_getoverrun - get overrun count for a POSIX per-process timer
timer_settimetimer_settime, timer_gettimetimer_gettime - arm/disarm and fetch state of POSIX per-process timer
timestimes - get process times
tkilltkill, tgkilltgkill - send a signal to a thread
truncatetruncate, ftruncateftruncate - truncate a file to a specified length
umaskumask - set file mode creation mask
umountumount, umount2umount2 - unmount filesystem
unameuname - get name and information about current kernel
unlinkunlink, unlinkatunlinkat - delete a name and possibly the file it refers to
unshareunshare - disassociate parts of the process execution context
uselibuselib - load shared library
userfaultfduserfaultfd - create a file descriptor for handling page faults in user space
ustatustat - get filesystem statistics
utimensatutimensat, futimensfutimens - change file timestamps with nanosecond precision
utimeutime, utimesutimes - change file last access and modification times
vforkvfork - create a child process and block parent
vhangupvhangup - virtually hangup the current terminal
vm86oldvm86old, vm86vm86 - enter virtual 8086 mode
vmsplicevmsplice - splice user pages into a pipe
wait3wait3, wait4wait4 - wait for process to change state, BSD style
waitwait, waitpid, waitidwaitid - wait for process to change state
writewrite - write to a file descriptor
Links:
linux/syscalls.h
2 syscalls
Directory of POSIX headers, man section 0
Directory of system calls, man section 2
kernel syscalls
System calls