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:

accept
The accept() system call is used with connection-based socket types (SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection request on the queue of...
access
access() checks whether the calling process can access the file pathname. If pathname is a symbolic link, it is dereferenced. The mode specifies the...
acct
The acct() system call enables or disables process accounting. If called with the name of an existing file as its argument, accounting is turned on, and records...
add_key
add_key() asks the kernel to create or update a key of the given type and description, instantiate it with the payload of length plen, and to attach it to the...
adjtimex
Linux uses David L. Mills' clock adjustment algorithm (see RFC 5905). The system call adjtimex() reads and optionally sets adjustment parameters for this...
alarm
alarm() arranges for a SIGALRM signal to be delivered to the calling process in seconds seconds. If seconds is zero, any pending alarm is canceled. In any event...
alloc_hugepages
The system calls alloc_hugepages() and free_hugepages() were introduced in Linux 2.5.36 and removed again in 2.5.54. They existed only on i386 and ia64 (when...
arch_prctl
The arch_prctl() function sets architecture-specific process or thread state. code selects a subfunction and passes argument addr to it; addr is interpreted as...
bdflush
Note: Since Linux 2.6, this system call is deprecated and does nothing. It is likely to disappear altogether in a future kernel release. Nowadays, the task...
bind
When a socket is created with socket(2), it exists in a name space (address family) but has no address assigned to it. bind() assigns the address specified by...
bpf
The bpf() system call performs a range of operations related to extended Berkeley Packet Filters. Extended BPF (or eBPF) is similar to the original ("classic")...
brk
brk() and sbrk() change the location of the program break, which defines the end of the process's data segment (i.e., the program break is the first location...
cacheflush
cacheflush() flushes the contents of the indicated cache(s) for the user addresses in the range addr to (addr+nbytes-1).
capget
As of Linux 2.2, the power of the superuser (root) has been partitioned into a set of discrete capabilities. Each thread has a set of effective capabilities...
chdir
chdir() changes the current working directory of the calling process to the directory specified in path. fchdir() is identical to chdir(); the only difference...
chmod
The chmod() and fchmod() system calls change a files mode bits. (The file mode consists of the file permission bits plus the set-user-ID, set-group-ID, and...
chown
These system calls change the owner and group of a file.
chroot
chroot() changes the root directory of the calling process to that specified in path. This directory will be used for pathnames beginning with /. The root...
clock_getres
The function clock_getres() finds the resolution (precision) of the specified clock clk_id, and, if res is non-NULL, stores it in the struct timespec pointed to...
clock_nanosleep
Like nanosleep(2), clock_nanosleep() allows the calling thread to sleep for an interval specified with nanosecond precision. It differs in allowing the caller...
clone
clone() creates a new process, in a manner similar to fork(2). This page describes both the glibc clone() wrapper function and the underlying system call on...
close
close() closes a file descriptor, so that it no longer refers to any file and may be reused. Any record locks (see fcntl(2)) held on the file it was associated...
connect
The connect() system call connects the socket referred to by the file descriptor sockfd to the address specified by addr. The addrlen argument specifies the...
copy_file_range
The copy_file_range() system call performs an in-kernel copy between two file descriptors without the additional cost of transferring data from the kernel to...
create_module
Note: This system call is present only in kernels before Linux 2.6. create_module() attempts to create a loadable module entry and reserve the kernel memory...
delete_module
The delete_module() system call attempts to remove the unused loadable module entry identified by name. If the module has an exit function, then that function...
dup
The dup() system call creates a copy of the file descriptor oldfd, using the lowest-numbered unused file descriptor for the new descriptor. After a successful...
epoll_create
epoll_create() creates an epoll(7) instance. Since Linux 2.6.8, the size argument is ignored, but must be greater than zero; see Notes below. epoll_create()...
epoll_ctl
This system call performs control operations on the epoll(7) instance referred to by the file descriptor epfd. It requests that the operation op be performed...
epoll_wait
The epoll_wait() system call waits for events on the epoll(7) instance referred to by the file descriptor epfd. The memory area pointed to by events will...
eventfd
eventfd() creates an "eventfd object" that can be used as an event wait/notify mechanism by user-space applications, and by the kernel to notify user-space...
execve
execve() executes the program pointed to by filename.
execveat
The execveat() system call executes the program referred to by the combination of dirfd and pathname. It operates in exactly the same way as execve(2), except...
_exit
The function _exit() terminates the calling process "immediately". Any open file descriptors belonging to the process are closed; any children of the process...
exit_group
This system call is equivalent to exit(2) except that it terminates not only the calling thread, but all threads in the calling process's thread group.
fallocate
This is a nonportable, Linux-specific system call. For the portable, POSIX.1-specified method of ensuring that space is allocated for a file, see...
fanotify_init
For an overview of the fanotify API, see fanotify(7). fanotify_init() initializes a new fanotify group and returns a file descriptor for the event queue...
fanotify_mark
For an overview of the fanotify API, see fanotify(7). fanotify_mark() adds, removes, or modifies an fanotify mark on a filesystem object. The caller must have...
fcntl
fcntl() performs one of the operations described below on the open file descriptor fd. The operation is determined by cmd. fcntl() can take an optional third...
flock
Apply or remove an advisory lock on the open file specified by fd.
fork
fork() creates a new process by duplicating the calling process. The new process is referred to as the child process. The calling process is referred to as the...
fsync
fsync() transfers ("flushes") all modified in-core data of (i.e., modified buffer cache pages for) the file referred to by the file descriptor fd to the disk...
futex
The futex() system call provides a method for waiting until a certain condition becomes true. It is typically used as a blocking construct in the context of...
futimesat
This system call is obsolete. Use utimensat(2) instead. The futimesat() system call operates in exactly the same way as utimes(2), except for the differences...
getcpu
The getcpu() system call identifies the processor and node on which the calling thread or process is currently running and writes them into the integers pointed...
getdents
These are not the interfaces you are interested in. Look at readdir(3) for the POSIX-conforming C library interface. This page documents the bare kernel system...
getdomainname
These functions are used to access or to change the NIS domain name of the host system. setdomainname() sets the domain name to the value given in the character...
getgid
getgid() returns the real group ID of the calling process. getegid() returns the effective group ID of the calling process.
getgroups
getgroups() returns the supplementary group IDs of the calling process in list. The argument size should be set to the maximum number of items that can be...
gethostname
These system calls are used to access or to change the hostname of the current processor. sethostname() sets the hostname to the value given in the character...
getitimer
These system calls provide access to interval timers, that is, timers that initially expire at some point in the future, and (optionally) at regular intervals...
get_kernel_syms
Note: This system call is present only in kernels before Linux 2.6. If table is NULL, get_kernel_syms() returns the number of symbols available for query.
get_mempolicy
get_mempolicy() retrieves the NUMA policy of the calling thread or of a memory address, depending on the setting of flags. A NUMA machine has different memory...
getpagesize
The function getpagesize() returns the number of bytes in a memory page, where "page" is a fixed-length block, the unit for memory allocation and file mapping...
getpeername
getpeername() returns the address of the peer connected to the socket sockfd, in the buffer pointed to by addr. The addrlen argument should be initialized to...
getpid
getpid() returns the process ID of the calling process. (This is often used by routines that generate unique temporary filenames.) getppid() returns the process...
getpriority
The scheduling priority of the process, process group, or user, as indicated by which and who is obtained with the getpriority() call and set with the...
getrandom
The getrandom() system call fills the buffer pointed to by buf with up to buflen random bytes. These bytes can be used to seed user-space random number...
getresuid
getresuid() returns the real UID, the effective UID, and the saved set-user-ID of the calling process, in the arguments ruid, euid, and suid, respectively...
getrlimit
The getrlimit() and setrlimit() system calls get and set resource limits respectively.
get_robust_list
The robust futex implementation needs to maintain per-thread lists of the robust futexes which are to be unlocked when the thread exits. These lists are managed...
getrusage
get resource usage
getsid
getsid(0) returns the session ID of the calling process. getsid() returns the session ID of the process with process ID pid. If pid is 0, getsid() returns the...
getsockname
getsockname() returns the current address to which the socket sockfd is bound, in the buffer pointed to by addr. The addrlen argument should be initialized to...
getsockopt
getsockopt() and setsockopt() manipulate options for the socket referred to by the file descriptor sockfd. Options may exist at multiple protocol levels; they...
gettid
gettid() returns the caller's thread ID (TID). In a single-threaded process, the thread ID is equal to the process ID (PID, as returned by getpid(2)). In a...
gettimeofday
The functions gettimeofday() and settimeofday() can get and set the time as well as a timezone.
getuid
getuid() returns the real user ID of the calling process. geteuid() returns the effective user ID of the calling process.
getunwind
Note: this function is obsolete. The IA-64-specific getunwind() system call copies the kernel's call frame unwind data into the buffer pointed to by buf and...
getxattr
Extended attributes are name:value pairs associated with inodes (files, directories, symbolic links, etc.). They are extensions to the normal attributes which...
idle
idle() is an internal system call used during bootstrap. It marks the process's pages as swappable, lowers its priority, and enters the main scheduling loop...
init_module
init_module() loads an ELF image into kernel space, performs any necessary symbol relocations, initializes module parameters to values provided by the caller...
inotify_add_watch
inotify_add_watch() adds a new watch, or modifies an existing watch, for the file whose location is specified in pathname; the caller must have read permission...
inotify_init
For an overview of the inotify API, see inotify(7). inotify_init() initializes a new inotify instance and returns a file descriptor associated with a new...
inotify_rm_watch
inotify_rm_watch() removes the watch associated with the watch descriptor wd from the inotify instance associated with the file descriptor fd. Removing a watch...
intro
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...
io_cancel
The io_cancel() system call attempts to cancel an asynchronous I/O operation previously submitted with io_submit(2). The iocb argument describes the operation...
ioctl
The ioctl() function manipulates the underlying device parameters of special files. In particular, many operating characteristics of character special files...
ioctl_fat
The ioctl(2) system call can be used to read and write metadata of FAT filesystems that are not accessible using other system calls.Reading and setting file...
ioctl_ficlonerange
If a filesystem supports files sharing physical storage between multiple files ("reflink"), this ioctl(2) operation can be used to make some of the data in the...
ioctl_fideduperange
If a filesystem supports files sharing physical storage between multiple files, this ioctl(2) operation can be used to make some of the data in the src_fd file...
ioctl_list
This is Ioctl List 1.3.27, a list of ioctl calls in Linux/i386 kernel 1.3.27. It contains 421 ioctls from </usr/include/{asm,linux}/*.h>. For each ioctl, its...
io_destroy
The io_destroy() system call will attempt to cancel all outstanding asynchronous I/O operations against ctx_id, will block on the completion of all operations...
io_getevents
The io_getevents() system call attempts to read at least min_nr events and up to nr events from the completion queue of the AIO context specified by ctx_id.
ioperm
ioperm() sets the port access permission bits for the calling thread for num bits starting from port address from. If turn_on is nonzero, then permission for...
iopl
iopl() changes the I/O privilege level of the calling process, as specified by the two least significant bits in level. This call is necessary to allow...
ioprio_set
The ioprio_get() and ioprio_set() system calls respectively get and set the I/O scheduling class and priority of one or more threads. The which and who...
io_setup
The io_setup() system call creates an asynchronous I/O context suitable for concurrently processing nr_events operations. The ctx_idp argument must not point to...
io_submit
The io_submit() system call queues nr I/O request blocks for processing in the AIO context ctx_id. The iocbpp argument should be an array of nr AIO control...
ipc
ipc() is a common kernel entry point for the System V IPC calls for messages, semaphores, and shared memory. call determines which IPC function to invoke; the...
kcmp
The kcmp() system call can be used to check whether the two processes identified by pid1 and pid2 share a kernel resource such as virtual memory, file...
kexec_load
The kexec_load() system call loads a new kernel that can be executed later by reboot(2). The flags argument is a bit mask that controls the operation of the...
keyctl
manipulate the kernel's key management facility
kill
The kill() system call can be used to send any signal to any process group or process. If pid is positive, then signal sig is sent to the process with the ID...
killpg
killpg() sends the signal sig to the process group pgrp. See signal(7) for a list of signals. If pgrp is 0, killpg() sends the signal to the calling process's...
link
link() creates a new link (also known as a hard link) to an existing file. If newpath exists, it will not be overwritten. This new name may be used exactly as...
listen
listen() marks the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to accept incoming connection requests using...
listxattr
Extended attributes are name:value pairs associated with inodes (files, directories, symbolic links, etc.). They are extensions to the normal attributes which...
llseek
The _llseek() function repositions the offset of the open file description associated with the file descriptor fd to (offset_high<<32) | offset_low bytes...
lookup_dcookie
Look up the full path of the directory entry specified by the value cookie. The cookie is an opaque identifier uniquely identifying a particular directory...
lseek
reposition read/write file offset
madvise
The madvise() system call is used to give advice or directions to the kernel about the address range beginning at address addr and with size length bytes...
mbind
mbind() sets the NUMA memory policy, which consists of a policy mode and zero or more nodes, for the memory range starting with addr and continuing for len...
membarrier
The membarrier() system call helps reducing the overhead of the memory barrier instructions required to order memory accesses on multi-core systems. However...
memfd_create
memfd_create() creates an anonymous file and returns a file descriptor that refers to it. The file behaves like a regular file, and so can be modified...
migrate_pages
migrate_pages() attempts to move all pages of the process pid that are in memory nodes old_nodes to the memory nodes in new_nodes. Pages not located in any node...
mincore
mincore() returns a vector that indicates whether pages of the calling process's virtual memory are resident in core (RAM), and so will not cause a disk access...
mkdir
mkdir() attempts to create a directory named pathname. The argument mode specifies the mode for the new directory (see stat(2)). It is modified by the process's...
mknod
The system call mknod() creates a filesystem node (file, device special file, or named pipe) named pathname, with attributes specified by mode and dev. The mode...
mlock
mlock(), mlock2(), and mlockall() lock part or all of the calling process's virtual address space into RAM, preventing that memory from being paged to the swap...
mmap
mmap() creates a new mapping in the virtual address space of the calling process. The starting address for the new mapping is specified in addr. The length...
mmap2
This is probably not the system call that you are interested in; instead, see mmap(2), which describes the glibc wrapper function that invokes this system call...
modify_ldt
modify_ldt() reads or writes the local descriptor table (LDT) for a process. The LDT is an array of segment descriptors that can be referenced by user code...
mount
mount() attaches the filesystem specified by source (which is often a pathname referring to a device, but can also be the pathname of a directory or file, or a...
move_pages
move_pages() moves the specified pages of the process pid to the memory nodes specified by nodes. The result of the move is reflected in status. The flags...
mprotect
mprotect() changes protection for the calling process's memory page(s) containing any part of the address range in the interval [addr, addr+len-1]. addr must be...
mq_getsetattr
Do not use this system call. This is the low-level system call used to implement mq_getattr(3) and mq_setattr(3). For an explanation of how this system call...
mremap
mremap() expands (or shrinks) an existing memory mapping, potentially moving it at the same time (controlled by the flags argument and the available virtual...
msgctl
msgctl() performs the control operation specified by cmd on the System V message queue with identifier msqid.
msgget
The msgget() system call returns the System V message queue identifier associated with the value of the key argument. A new message queue is created if key has...
msgop
The msgsnd() and msgrcv() system calls are used, respectively, to send messages to, and receive messages from, a System V message queue. The calling process...
msync
msync() flushes changes made to the in-core copy of a file that was mapped into memory using mmap(2) back to the filesystem. Without use of this call, there is...
nanosleep
nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed, or the delivery of a signal that triggers...
nfsservctl
Note: Since Linux 3.1, this system call no longer exists. It has been replaced by a set of files in the nfsd filesystem; see nfsd(7).
nice
nice() adds inc to the nice value for the calling process. (A higher nice value means a low priority.) Only the superuser may specify a negative increment, or...
open
Given a pathname for a file, open() returns a file descriptor, a small, nonnegative integer for use in subsequent system calls (read(2), write(2), lseek(2)...
open_by_handle_at
The name_to_handle_at() and open_by_handle_at() system calls split the functionality of openat(2) into two parts: name_to_handle_at() returns an opaque handle...
outb
This family of functions is used to do low-level port input and output. The out* functions do port output, the in* functions do port input; the b-suffix...
pause
pause() causes the calling process (or thread) to sleep until a signal is delivered that either terminates the process or causes the invocation of a...
perf_event_open
Given a list of parameters, perf_event_open() returns a file descriptor, for use in subsequent system calls (read(2), mmap(2), prctl(2), fcntl(2), etc.). A call...
perfmonctl
The IA-64-specific perfmonctl() system call provides an interface to the PMU (performance monitoring unit). The PMU consists of PMD (performance monitoring...
personality
Linux supports different execution domains, or personalities, for each process. Among other things, execution domains tell Linux how to map signal numbers into...
pipe
pipe() creates a pipe, a unidirectional data channel that can be used for interprocess communication. The array pipefd is used to return two file descriptors...
pivot_root
pivot_root() moves the root filesystem of the calling process to the directory put_old and makes new_root the new root filesystem of the calling process. The...
poll
poll() performs a similar task to select(2): it waits for one of a set of file descriptors to become ready to perform I/O.
posix_fadvise
Programs can use posix_fadvise() to announce an intention to access file data in a specific pattern in the future, thus allowing the kernel to perform...
prctl
prctl() is called with a first argument describing what to do (with values defined in <linux/prctl.h>), and further arguments with a significance depending on...
pread
pread() reads up to count bytes from file descriptor fd at offset offset (from the start of the file) into the buffer starting at buf. The file offset is not...
process_vm_readv
These system calls transfer data between the address space of the calling process ("the local process") and the process identified by pid ("the remote...
ptrace
The ptrace() system call provides a means by which one process (the "tracer") may observe and control the execution of another process (the "tracee"), and...
query_module
Note: This system call is present only in kernels before Linux 2.6. query_module() requests information from the kernel about loadable modules. The returned...
quotactl
The quota system can be used to set per-user, per-group, and per-project limits on the amount of disk space used on a filesystem. For each user and/or group, a...
read
read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. On files that support seeking, the read operation commences...
readahead
readahead() initiates readahead on a file so that subsequent reads from that file will be satisfied from the cache, and not block on disk I/O (assuming the...
readdir
This is not the function you are interested in. Look at readdir(3) for the POSIX conforming C library interface. This page documents the bare kernel system call...
readlink
readlink() places the contents of the symbolic link pathname in the buffer buf, which has size bufsiz. readlink() does not append a null byte to buf. It will...
readv
The readv() system call reads iovcnt buffers from the file associated with the file descriptor fd into the buffers described by iov ("scatter input"). The...
reboot
The reboot() call reboots the system, or enables/disables the reboot keystroke (abbreviated CAD, since the default is Ctrl-Alt-Delete; it can be changed using...
recv
The recv(), recvfrom(), and recvmsg() calls are used to receive messages from a socket. They may be used to receive data on both connectionless and...
recvmmsg
The recvmmsg() system call is an extension of recvmsg(2) that allows the caller to receive multiple messages from a socket using a single system call. (This has...
remap_file_pages
Note: this system call is (since Linux 3.16) deprecated and will eventually be replaced by a slower in-kernel emulation. Those few applications that use this...
removexattr
Extended attributes are name:value pairs associated with inodes (files, directories, symbolic links, etc.). They are extensions to the normal attributes which...
rename
rename() renames a file, moving it between directories if required. Any other hard links to the file (as created using link(2)) are unaffected. Open file...
request_key
request_key() asks the kernel to find a key of the given type that matches the specified description and, if successful, to attach it to the nominated keyring...
restart_syscall
The restart_syscall() system call is used to restart certain system calls after a process that was stopped by a signal (e.g., SIGSTOP or SIGTSTP) is later...
rmdir
rmdir() deletes a directory, which must be empty.
rtas
ppc_rtas enables userspace manipulation of the RunTime Abstraction Services (RTAS). RTAS provides for a portable method of access and setting system...
rt_sigqueueinfo
The rt_sigqueueinfo() and rt_tgsigqueueinfo() system calls are the low-level interfaces used to send a signal plus data to a process or thread. The receiver of...
s390_pci_mmio_write
The s390_pci_mmio_write() system call writes length bytes of data from the user-space buffer user_buffer to the PCI MMIO memory location specified by mmio_addr...
s390_runtime_instr
The s390_runtime_instr() system call starts or stops CPU run-time instrumentation for the calling thread. The command argument controls whether run-time...
sched_get_priority_max
sched_get_priority_max() returns the maximum priority value that can be used with the scheduling algorithm identified by policy. sched_get_priority_min()...
sched_rr_get_interval
sched_rr_get_interval() writes into the timespec structure pointed to by tp the round-robin time quantum for the process identified by pid. The specified...
sched_setaffinity
A thread's CPU affinity mask determines the set of CPUs on which it is eligible to run. On a multiprocessor system, setting the CPU affinity mask can be used to...
sched_setattr
sched_setattr() The sched_setattr() system call sets the scheduling policy and associated attributes for the thread whose ID is specified in pid. If pid equals...
sched_setparam
sched_setparam() sets the scheduling parameters associated with the scheduling policy for the process identified by pid. If pid is zero, then the parameters of...
sched_setscheduler
The sched_setscheduler() system call sets both the scheduling policy and parameters for the thread whose ID is specified in pid. If pid equals zero, the...
sched_yield
sched_yield() causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and a new thread gets to run.
seccomp
The seccomp() system call operates on the Secure Computing (seccomp) state of the calling process.
select
select() and pselect() allow a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of...
select_tut
select() (or pselect()) is used to efficiently monitor multiple file descriptors, to see if any of them is, or becomes, "ready"; that is, to see whether I/O...
semctl
semctl() performs the control operation specified by cmd on the System V semaphore set identified by semid, or on the semnum-th semaphore of that set. (The...
semget
The semget() system call returns the System V semaphore set identifier associated with the argument key. A new set of nsems semaphores is created if key has the...
semop
System V semaphore operations
send
The system calls send(), sendto(), and sendmsg() are used to transmit a message to another socket. The send() call may be used only when the socket is in a...
sendfile
sendfile() copies data between one file descriptor and another. Because this copying is done within the kernel, sendfile() is more efficient than the...
sendmmsg
The sendmmsg() system call is an extension of sendmsg(2) that allows the caller to transmit multiple messages on a socket using a single system call. (This has...
seteuid
seteuid() sets the effective user ID of the calling process. Unprivileged processes may only set the effective user ID to the real user ID, the effective user...
setfsgid
The system call setfsgid() changes the value of the caller's filesystem group ID—the group ID that the Linux kernel uses to check for all accesses to the...
setfsuid
The system call setfsuid() changes the value of the caller's filesystem user ID—the user ID that the Linux kernel uses to check for all accesses to the...
setgid
setgid() sets the effective group ID of the calling process. If the calling process is privileged (has the CAP_SETGID capability in its user namespace), the...
set_mempolicy
set_mempolicy() sets the NUMA memory policy of the calling thread, which consists of a policy mode and zero or more nodes, to the values specified by the mode...
setns
Given a file descriptor referring to a namespace, reassociate the calling thread with that namespace. The fd argument is a file descriptor referring to one of...
setpgid
All of these interfaces are available on Linux, and are used for getting and setting the process group ID (PGID) of a process. The preferred, POSIX.1-specified...
setresuid
setresuid() sets the real user ID, the effective user ID, and the saved set-user-ID of the calling process. An unprivileged process may change its real UID...
setreuid
setreuid() sets real and effective user IDs of the calling process. Supplying a value of -1 for either the real or effective user ID forces the system to leave...
setsid
setsid() creates a new session if the calling process is not a process group leader. The calling process is the leader of the new session (i.e., its session ID...
set_thread_area
Linux dedicates three global descriptor table (GDT) entries for thread-local storage. For more information about the GDT, see the Intel Software Developer's...
set_tid_address
For each thread, the kernel maintains two attributes (addresses) called set_child_tid and clear_child_tid. These two attributes contain the value NULL by...
setuid
setuid() sets the effective user ID of the calling process. If the calling process is privileged (more precisely: if the process has the CAP_SETUID capability...
setup
setup() is called once from within linux/init/main.c. It calls initialization functions for devices and filesystems configured into the kernel and then mounts...
setxattr
Extended attributes are name:value pairs associated with inodes (files, directories, symbolic links, etc.). They are extensions to the normal attributes which...
sgetmask
These system calls are obsolete. Do not use them; use sigprocmask(2) instead. sgetmask() returns the signal mask of the calling process. ssetmask() sets the...
shmctl
shmctl() performs the control operation specified by cmd on the System V shared memory segment whose identifier is given in shmid.
shmget
shmget() returns the identifier of the System V shared memory segment associated with the value of the argument key. A new shared memory segment, with size...
shmop
shmat() shmat() attaches the System V shared memory segment identified by shmid to the address space of the calling process. The attaching address is specified...
shutdown
The shutdown() call causes all or part of a full-duplex connection on the socket associated with sockfd to be shut down. If how is SHUT_RD, further receptions...
sigaction
The sigaction() system call is used to change the action taken by a process on receipt of a specific signal. (See signal(7) for an overview of signals.) signum...
sigaltstack
sigaltstack() allows a process to define a new alternate signal stack and/or retrieve the state of an existing alternate signal stack. An alternate signal stack...
signal
The behavior of signal() varies across UNIX versions, and has also varied historically across different versions of Linux. Avoid its use: use sigaction(2)...
signalfd
signalfd() creates a file descriptor that can be used to accept signals targeted at the caller. This provides an alternative to the use of a signal handler or...
sigpending
sigpending() returns the set of signals that are pending for delivery to the calling thread (i.e., the signals which have been raised while blocked). The mask...
sigprocmask
sigprocmask() is used to fetch and/or change the signal mask of the calling thread. The signal mask is the set of signals whose delivery is currently blocked...
sigreturn
If the Linux kernel determines that an unblocked signal is pending for a process, then, at the next transition back to user mode in that process (e.g., upon...
sigsuspend
sigsuspend() temporarily replaces the signal mask of the calling process with the mask given by mask and then suspends the process until delivery of a signal...
sigwaitinfo
sigwaitinfo() suspends execution of the calling thread until one of the signals in set is pending (If one of the signals in set is already pending for the...
socket
socket() creates an endpoint for communication and returns a file descriptor that refers to that endpoint. The domain argument specifies a communication domain...
socketcall
socketcall() is a common kernel entry point for the socket system calls. call determines which socket function to invoke. args points to a block containing the...
socketpair
The socketpair() call creates an unnamed pair of connected sockets in the specified domain, of the specified type, and using the optionally specified protocol...
splice
splice() moves data between two file descriptors without copying between kernel address space and user address space. It transfers up to len bytes of data from...
spu_create
The spu_create() system call is used on PowerPC machines that implement the Cell Broadband Engine Architecture in order to access Synergistic Processor Units...
spu_run
The spu_run() system call is used on PowerPC machines that implement the Cell Broadband Engine Architecture in order to access Synergistic Processor Units...
stat
These functions return information about a file, in the buffer pointed to by buf. No permissions are required on the file itself, but—in the case of stat()...
statfs
The statfs() system call returns information about a mounted filesystem. path is the pathname of any file within the mounted filesystem.
stime
stime() sets the system's idea of the time and date. The time, pointed to by t, is measured in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). stime()...
subpage_prot
The PowerPC-specific subpage_prot() system call provides the facility to control the access permissions on individual 4kB subpages on systems configured with a...
swapcontext
swapcontext swaps out context old_ctx with new context new_ctx. The int r# values have no place in the system call functionality. The regs value indicates the...
swapon
swapon() sets the swap area to the file or block device specified by path. swapoff() stops swapping to the file or block device specified by path. If the...
symlink
symlink() creates a symbolic link named linkpath which contains the string target. Symbolic links are interpreted at run time as if the contents of the link had...
sync
sync() causes all pending modifications to file system metadata and cached file data to be written to the underlying filesystems. syncfs() is like sync(), but...
sync_file_range
sync_file_range() permits fine control when synchronizing the open file referred to by the file descriptor fd with disk. offset is the starting byte of the file...
syscall
syscall() is a small library function that invokes the system call whose assembly language interface has the specified number with the specified arguments...
_syscall
The important thing to know about a system call is its prototype. You need to know how many arguments, their types, and the function return type. There are...
syscalls
The system call is the fundamental interface between an application and the Linux kernel.System calls and library wrapper functions System calls are generally...
sysctl
Do not use this system call! See Notes. The _sysctl() call reads and/or writes kernel parameters. For example, the hostname, or the maximum number of open...
sysfs
sysfs() returns information about the filesystem types currently present in the kernel.
sysinfo
sysinfo() returns certain statistics on memory and swap usage, as well as the load average.
syslog
Note: Probably, you are looking for the C library function syslog(), which talks to syslogd(8); see syslog(3) for details. This page describes the kernel...
tee
tee() duplicates up to len bytes of data from the pipe referred to by the file descriptor fd_in to the pipe referred to by the file descriptor fd_out. It does...
time
time() returns the time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). If tloc is non-NULL, the return value is also stored in the...
timer_create
timer_create() creates a new per-process interval timer. The ID of the new timer is returned in the buffer pointed to by timerid, which must be a non-null...
timer_delete
timer_delete() deletes the timer whose ID is given in timerid. If the timer was armed at the time of this call, it is disarmed before being deleted. The...
timerfd_create
These system calls create and operate on a timer that delivers timer expiration notifications via a file descriptor. They provide an alternative to the use of...
timer_getoverrun
timer_getoverrun() returns the "overrun count" for the timer referred to by timerid. An application can use the overrun count to accurately calculate the number...
timer_settime
timer_settime() arms or disarms the timer identified by timerid. The new_value argument is pointer to an itimerspec structure that specifies the new initial...
times
times() stores the current process times in the struct tms that buf points to.
tkill
tgkill() sends the signal sig to the thread with the thread ID tid in the thread group tgid. (By contrast, kill(2) can be used to send a signal only to a...
truncate
The truncate() and ftruncate() functions cause the regular file named by path or referenced by fd to be truncated to a size of precisely length bytes. If the...
umask
umask() sets the calling process's file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the...
umount
umount() and umount2() remove the attachment of the (topmost) filesystem mounted on target. Appropriate privilege (Linux: the CAP_SYS_ADMIN capability) is...
uname
uname() returns system information in the structure pointed to by buf.
unimplemented
These system calls are not implemented in the Linux kernel.
unlink
unlink() deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it...
unshare
unshare() allows a process (or thread) to disassociate parts of its execution context that are currently being shared with other processes (or threads). Part of...
uselib
The system call uselib() serves to load a shared library to be used by the calling process. It is given a pathname. The address where to load is found in the...
ustat
ustat() returns information about a mounted filesystem. dev is a device number identifying a device containing a mounted filesystem.
utime
Note: modern applications may prefer to use the interfaces described in utimensat(2). The utime() system call changes the access and modification times of the...
utimensat
utimensat() and futimens() update the timestamps of a file with nanosecond precision. This contrasts with the historical utime(2) and utimes(2), which permit...
vfork
Standard description (From POSIX.1) The vfork() function has the same effect as fork(2), except that the behavior is undefined if the process created by vfork()...
vhangup
vhangup() simulates a hangup on the current terminal. This call arranges for other users to have a “clean” terminal at login time.
vm86
The system call vm86() was introduced in Linux 0.97p2. In Linux 2.1.15 and 2.0.28, it was renamed to vm86old(), and a new vm86() was introduced. The definition...
vmsplice
The vmsplice() system call maps nr_segs ranges of user memory described by iov into a pipe. The file descriptor fd must refer to a pipe.
wait
All of these system calls are used to wait for state changes in a child of the calling process, and obtain information about the child whose state has changed...
wait4
These functions are obsolete; use waitpid(2) or waitid(2) in new programs. The wait3() and wait4() system calls are similar to waitpid(2), but additionally...
write
write() writes up to count bytes from the buffer pointed buf to the file referred to by the file descriptor fd. The number of bytes written may be less than...