Section 2: System Calls

1 2 3 4 5 6 7 8 0p 1p 3p n
Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel. Usually, system calls are not invoked directly: instead, most system calls have corresponding C library wrapper functions which perform the steps required (e.g., trapping to kernel mode) in order to invoke the system call. Thus, making a system call looks the same as invoking a normal library function. For a list of the Linux system calls, see syscalls(2).

Man pages in this section:

acceptaccept a connection on a socket
accesscheck user's permissions for a file
acctswitch process accounting on or off
add_keyadd a key to the kernel's key management facility
adjtimextune kernel clock
alarmset an alarm clock for delivery of a signal
alloc_hugepagesallocate or free huge pages
arch_prctlset architecture-specific thread state
bdflushstart, flush, or tune buffer-dirty-flush daemon
bindbind a name to a socket
bpfperform a command on an extended BPF map or program
brkchange data segment size
cacheflushflush contents of instruction and/or data cache
capgetset/get capabilities of thread(s)
chdirchange working directory
chmodchange permissions of a file
chownchange ownership of a file
chrootchange root directory
clock_getresclock and time functions
clock_nanosleephigh-resolution sleep with specifiable clock
clonecreate a child process
closeclose a file descriptor
connectinitiate a connection on a socket
copy_file_rangeCopy a range of data from one file to another
create_modulecreate a loadable module entry
delete_moduleunload a kernel module
dupduplicate a file descriptor
epoll_createopen an epoll file descriptor
epoll_ctlcontrol interface for an epoll file descriptor
epoll_waitwait for an I/O event on an epoll file descriptor
eventfdcreate a file descriptor for event notification
execveexecute program
execveatexecute program relative to a directory file descriptor
_exitterminate the calling process
exit_groupexit all threads in a process
fallocatemanipulate file space
fanotify_initcreate and initialize fanotify group
fanotify_markadd, remove, or modify an fanotify mark on a filesystem object
fcntlmanipulate file descriptor
flockapply or remove an advisory lock on an open file
forkcreate a child process
fsyncsynchronize a file's in-core state with storage device
futexfast user-space locking
futimesatchange timestamps of a file relative to a directory file descriptor
getcpudetermine CPU and NUMA node on which the calling thread is running
getdentsget directory entries
getdomainnameget/set NIS domain name
getgidget group identity
getgroupsget/set list of supplementary group IDs
gethostnameget/set hostname
getitimerget or set value of an interval timer
get_kernel_symsretrieve exported kernel and module symbols
get_mempolicyretrieve NUMA memory policy for a thread
getpagesizeget memory page size
getpeernameget name of connected peer socket
getpidget process identification
getpriorityget/set program scheduling priority
getrandomobtain a series of random bytes
getresuidget real, effective and saved user/group IDs
getrlimitget/set resource limits
get_robust_listget/set list of robust futexes
getrusageget resource usage
getsidget session ID
getsocknameget socket name
getsockoptget and set options on sockets
gettidget thread identification
gettimeofdayget / set time
getuidget user identity
getunwindcopy the unwind data to caller's buffer
getxattrretrieve an extended attribute value
idlemake process 0 idle
init_moduleload a kernel module
inotify_add_watchadd a watch to an initialized inotify instance
inotify_initinitialize an inotify instance
inotify_rm_watchremove an existing watch from an inotify instance
introintroduction to system calls
io_cancelcancel an outstanding asynchronous I/O operation
ioctlcontrol device
ioctl_consoleioctls for console terminal and virtual consoles
ioctl_fatmanipulating the FAT filesystem
ioctl_ficlonerangeshare some the data of one file with another file
ioctl_fideduperangeshare some the data of one file with another file
ioctl_getfsmapretrieve the physical layout of the filesystem
ioctl_iflagsioctl() operations for inode flags
ioctl_listlist of ioctl calls in Linux/i386 kernel
ioctl_nsioctl() operations for Linux namespaces
ioctl_ttyioctls for terminals and serial lines
ioctl_userfaultfdcreate a file descriptor for handling page faults in user space
io_destroydestroy an asynchronous I/O context
io_geteventsread asynchronous I/O events from the completion queue
iopermset port input/output permissions
ioplchange I/O privilege level
ioprio_setget/set I/O scheduling class and priority
io_setupcreate an asynchronous I/O context
io_submitsubmit asynchronous I/O blocks for processing
ipcSystem V IPC system calls
kcmpcompare two processes to determine if they share a kernel resource
kexec_loadload a new kernel for later execution
keyctlmanipulate the kernel's key management facility
killsend signal to a process
linkmake a new name for a file
listenlisten for connections on a socket
listxattrlist extended attribute names
llseekreposition read/write file offset
lookup_dcookiereturn a directory entry's path
lseekreposition read/write file offset
madvisegive advice about use of memory
mbindset memory policy for a memory range
membarrierissue memory barriers on a set of threads
memfd_createcreate an anonymous file
migrate_pagesmove all pages in a process to another set of nodes
mincoredetermine whether pages are resident in memory
mkdircreate a directory
mknodcreate a special or ordinary file
mlocklock and unlock memory
mmapmap or unmap files or devices into memory
mmap2map files or devices into memory
modify_ldtget or set a per-process LDT entry
mountmount filesystem
move_pagesmove individual pages of a process to another node
mprotectset protection on a region of memory
mq_getsetattrget/set message queue attributes
mremapremap a virtual memory address
msgctlSystem V message control operations
msggetget a System V message queue identifier
msgopSystem V message queue operations
msyncsynchronize a file with a memory map
nanosleephigh-resolution sleep
nfsservctlsyscall interface to kernel nfs daemon
nicechange process priority
openopen and possibly create a file
open_by_handle_atobtain handle for a pathname and open file via a handle
outbport I/O
pausewait for signal
perf_event_openset up performance monitoring
perfmonctlinterface to IA-64 performance monitoring unit
personalityset the process execution domain
pipecreate pipe
pivot_rootchange the root filesystem
pkey_allocallocate or free a protection key
pollwait for some event on a file descriptor
posix_fadvisepredeclare an access pattern for file data
prctloperations on a process
preadread from or write to a file descriptor at a given offset
process_vm_readvtransfer data between process address spaces
ptraceprocess trace
query_modulequery the kernel for various bits pertaining to modules
quotactlmanipulate disk quotas
readread from a file descriptor
readaheadinitiate file readahead into page cache
readdirread directory entry
readlinkread value of a symbolic link
readvread or write data into multiple buffers
rebootreboot or enable/disable Ctrl-Alt-Del
recvreceive a message from a socket
recvmmsgreceive multiple messages on a socket
remap_file_pagescreate a nonlinear file mapping
removexattrremove an extended attribute
renamechange the name or location of a file
request_keyrequest a key from the kernel's key management facility
restart_syscallrestart a system call after interruption by a stop signal
rmdirdelete a directory
rtasAllows userspace to call RTAS (Run Time Abstraction Services)
rt_sigqueueinfoqueue a signal and data
s390_pci_mmio_writetransfer data to/from PCI MMIO memory page
s390_runtime_instrenable/disable s390 CPU run-time instrumentation
sched_get_priority_maxget static priority range
sched_rr_get_intervalget the SCHED_RR interval for the named process
sched_setaffinityset and get a thread's CPU affinity mask
sched_setattrset and get scheduling policy and attributes
sched_setparamset and get scheduling parameters
sched_setschedulerset and get scheduling policy/parameters
sched_yieldyield the processor
seccompoperate on Secure Computing state of the process
selectsynchronous I/O multiplexing
select_tutsynchronous I/O multiplexing
semctlSystem V semaphore control operations
semgetget a System V semaphore set identifier
semopSystem V semaphore operations
sendsend a message on a socket
sendfiletransfer data between file descriptors
sendmmsgsend multiple messages on a socket
seteuidset effective user or group ID
setfsgidset group identity used for filesystem checks
setfsuidset user identity used for filesystem checks
setgidset group identity
set_mempolicyset default NUMA memory policy for a thread and its children
setnsreassociate thread with a namespace
setpgidset/get process group
setresuidset real, effective and saved user or group ID
setreuidset real and/or effective user or group ID
setsidcreates a session and sets the process group ID
set_thread_areaset a GDT entry for thread-local storage
set_tid_addressset pointer to thread ID
setuidset user identity
setupsetup devices and filesystems, mount root filesystem
setxattrset an extended attribute value
sgetmaskmanipulation of signal mask (obsolete)
shmctlSystem V shared memory control
shmgetallocates a System V shared memory segment
shmopSystem V shared memory operations
shutdownshut down part of a full-duplex connection
sigactionexamine and change a signal action
sigaltstackset and/or get signal stack context
signalANSI C signal handling
signalfdcreate a file descriptor for accepting signals
sigpendingexamine pending signals
sigprocmaskexamine and change blocked signals
sigreturnreturn from signal handler and cleanup stack frame
sigsuspendwait for a signal
sigwaitinfosynchronously wait for queued signals
socketcreate an endpoint for communication
socketcallsocket system calls
socketpaircreate a pair of connected sockets
splicesplice data to/from a pipe
spu_createcreate a new spu context
spu_runexecute an SPU context
statget file status
statfsget filesystem statistics
statxget file status (extended)
stimeset time
subpage_protdefine a subpage protection for an address range
swapcontextSwap out old context with new context
swaponstart/stop swapping to file/device
symlinkmake a new name for a file
synccommit filesystem caches to disk
sync_file_rangesync a file segment with disk
syscallindirect system call
_syscallinvoking a system call without library support (OBSOLETE)
syscallsLinux system calls
sysctlread/write system parameters
sysfsget filesystem type information
sysinforeturn system information
syslogread and/or clear kernel message ring buffer; set console_loglevel
teeduplicating pipe content
timeget time in seconds
timer_createcreate a POSIX per-process timer
timer_deletedelete a POSIX per-process timer
timerfd_createtimers that notify via file descriptors
timer_getoverrunget overrun count for a POSIX per-process timer
timer_settimearm/disarm and fetch state of POSIX per-process timer
timesget process times
tkillsend a signal to a thread
truncatetruncate a file to a specified length
umaskset file mode creation mask
umountunmount filesystem
unameget name and information about current kernel
unimplementedunimplemented system calls
unlinkdelete a name and possibly the file it refers to
unsharedisassociate parts of the process execution context
uselibload shared library
userfaultfdcreate a file descriptor for handling page faults in user space
ustatget filesystem statistics
utimechange file last access and modification times
utimensatchange file timestamps with nanosecond precision
vforkcreate a child process and block parent
vhangupvirtually hangup the current terminal
vm86enter virtual 8086 mode
vmsplicesplice user pages into a pipe
waitwait for process to change state
wait4wait for process to change state, BSD style
writewrite to a file descriptor