List of Linux system calls
List of system calls of the Linux kernel:
Name x86_64 | function | Number in x86 64 (% RAX ) | Number in i386 | Different name in i386 |
---|---|---|---|---|
read | Reads file from file descriptor fd | 0 | 3 | |
write | Writes file to file descriptor fd | 1 | 4th | |
open | Opens file or device | 2 | 5 | |
close | Closes the file or device | 3 | 6th | |
stat | Status of a file | 4th | 18th | oldstat |
fstat | Status of a file | 5 | 28 | oldfstat |
lstat | Status of a file | 6th | 84 | oldlstat |
poll | Waiting for event | 7th | 168 | |
lseek | Repositions the offset of a read / write pointer to files | 8th | 19th | |
mmap | Maps file into memory | 9 | 90 | |
mprotect | Protects memory area | 10 | 125 | |
munmap | Removes the mapped file from the memory | 11 | 91 | |
brk | Changes the size of a data segment | 12 | 45 | |
rt_sigaction | Changes the function of a signal (except SIGKILL and SIGSTOP ) | 13 | 67 | sigaction |
rt_sigprocmask | Blocks signals | 14th | 126 | sigprocmask |
rt_sigreturn | Resets all signals | 15th | 119 | sigreturn |
ioctl | input / output control (communication with devices) | 16 | 54 | |
pread64 | Reads file at a specific point | 17th | 180 | |
pwrite64 | Writes file in a specific place | 18th | 181 | |
readv | Writes file to multiple buffers | 19th | 145 | |
writev | Reads file into multiple buffers | 20th | 146 | |
access | Checks a user's authorization for a file | 21st | 33 | |
pipe | Creates a pipe | 22nd | 42 | |
select | synchronous I / O multiplexing (monitor several files until they become writable, for example) | 23 | 82 | |
sched_yield | Instructs the process scheduler to move on to the next process | 24 | 158 | |
mremap | Moves a virtual memory address | 25th | 163 | |
msync | Synchronizes a file with its memory-mapped copy in memory | 26th | 144 | |
mincore | Determines whether a memory page is not paged out | 27 | 218 | |
madvise | Gives the kernel an indication of whether a memory area will be accessed soon and whether it will be accessed more randomly or sequentially | 28 | 219 | |
shmget | Sets the common memory ( shared memory ) to | 29 | / | |
shmat | Binds XSI shared memory a | 30th | / | |
shmctl | Manages properties of shared storage | 31 | / | |
dup | Generates a second filehandle for the same file | 32 | 41 | |
dup2 | Generates a second filehandle for the same file with a specific number | 33 | 63 | |
Break | Blocks process and waits for any signal | 34 | 29 | |
nanosleep | Blocks process and waits for any high resolution signal | 35 | 162 | |
getitimer | Asks the interval timer from | 36 | ||
alarm | Sends SIGALARM after a period has elapsed
|
37 | ||
setitimer | Sets the interval timer | 38 | ||
getpid | Returns the process identifier (PID) | 39 | ||
sendfile | Copies data between two file descriptors | 40 | ||
socket | Opens a socket | 41 | ||
connect | Establishes a connection with a server (process) | 42 | ||
accept | Waiting for requests from clients | 43 | ||
sendto | Sends a message to a socket | 44 | ||
recvfrom | Receives a message from a socket | 45 | ||
sendmsg | Sends a message to a socket, possibly with control information | 46 | ||
recvmsg | Receives a message from a socket, possibly with control information | 47 | ||
shut down | Closes a socket connection on one or both sides | 48 | ||
bind | Binds an already open socket to an address | 49 | ||
list | Marks a socket as passive listening | 50 | ||
getsockname | Returns the address of a bound socket | 51 | ||
getpeername | Returns the address of a connected on a socket peers back | 52 | ||
socketpair | Creates a pair of connected sockets of the desired protocol and type | 53 | ||
setsockopt | Sets or changes the settings of a socket | 54 | ||
getsockopt | Returns the settings of a socket | 55 | ||
clone | Creates a child process with the ability to share resources from the parent process | 56 | ||
fork | Creates a child process ( fork ) | 57 | ||
vfork | Creates a child process and blocks the parent process | 58 | ||
execve | Loads the contents of an executable file and starts it | 59 | ||
exit | Terminates ongoing process | 60 | ||
wait4 | Waits until a child process terminates and returns information on its resource consumption | 61 | ||
kill | Sends a signal to a process | 62 | ||
uname | Returns information about the running kernel | 63 | ||
semget | Generates a pair of semaphores | 64 | ||
semop | Ensures that the semaphore operations are only carried out if all operations succeed | 65 | ||
semctl | Controls semaphores | 66 | ||
shmdt | Releases memory from shared memory | 67 | ||
msgget | Receives a message queue identifier | 68 | ||
msgsnd | Sends a message via a message queue | 69 | ||
msgrcv | Receives a message via a message queue | 70 | ||
msgctl | Changes or deletes a message queue | 71 | ||
fcntl | Manipulates a file descriptor | 72 | ||
flock | Sets or removes an advisory lock on or from an open file | 73 | ||
fsync | Synchronizes a referenced file with its representation in mass storage | 74 | ||
fdatasync | As best fsync omitting. non-mandatory metadata | 75 | ||
truncate | Shortens a file to the required length or extends it with zero bytes | 76 | ||
ftruncate | How to truncate over referencing with a descriptor | 77 | ||
getdents | Returns dirent structures of a directory into a buffer | 78 | ||
getcwd | Returns the current working directory ( Current Working Directory ) back | 79 | ||
chdir | Sets or changes the current working directory as a path | 80 | ||
fchdir | Like chdir , but target directory via descriptor | 81 | ||
rename | Renames a file and moves it if necessary | 82 | ||
mkdir | Creates a directory | 83 | ||
rmdir | Removes a directory | 84 | ||
creat | Opens and, if necessary, creates or overwrites a file for writing | 85 | ||
link | Creates a hard link to a file | 86 | ||
unlink | Deletes a hard link and, if necessary, a file | 87 | ||
symlink | Creates a soft link to a file | 88 | ||
readlink | Returns the content of a soft link | 89 | ||
chmod | Changes file attributes | 90 | ||
fchmod | Changes file attributes as a descriptor | 91 | ||
chown | Changes the owner of a file | 92 | ||
fchown | Changes the owner of a file as a descriptor | 93 | ||
lchown | How chown but does not dereference any soft links | 94 | ||
umask | Sets the rights mask ( umask ) of the calling process | 95 | ||
gettimeofday | Returns the time or time zone | 96 | ||
trlimit | Returns information about existing resource limits | 97 | ||
Getrusage | Returns information about the resource consumption of the calling process, thread or its children | 98 | ||
sysinfo | Retrieves system statistics | 99 | ||
times | Returns information about the runtime of the calling process | 100 | ||
ptrace | Following ( trace ) another process | 101 | ||
getuid | Returns the actual user ID | 102 | ||
syslog | Checks the kernel message ring buffer and sets the console_loglevel | 103 | ||
getgid | Returns the actual group identifier | 104 | ||
setuid | Sets the effective user ID | 105 | ||
setgid | Sets the effective group ID | 106 | ||
good | Returns the effective user ID | 107 | ||
getegid | Returns the effective group ID | 108 | ||
setpgid | Sets the process group identifier (PGID) | 109 | ||
getppid | Returns the process ID of the parent process (PPID) | 110 | ||
getpgrp | Returns the process group identifier (PGID) | 111 | ||
setsid | Creates a new session with the calling process as leader and returns the session ID (SID) | 112 | ||
setreuid | Sets the effective and actual user ID | 113 | ||
setregid | Sets the effective and actual group ID | 114 | ||
getgroups | Returns a list of additional group IDs ( supplementary group IDs ) back | 115 | ||
setgroups | Expect a list of additional group IDs | 116 | ||
setresuid | Sets actual, effective and set user ID | 117 | ||
Getresuid | Is the actual, effective and Set User ID back | 118 | ||
setresgid | Sets actual, effective and group setuid | 119 | ||
Getresgid | Returns the actual, effective, and group setuid | 120 | ||
getpgid | Returns the process group ID of a process | 121 | ||
setfsuid | Changes the user ID for access to the file system | 122 | ||
setfsgid | Changes the group ID for access to the file system | 123 | ||
getsid | Returns the session ID | 124 | ||
capget | Returns the capabilities of a thread | 125 | ||
capset | Determines the capabilities of a thread | 126 | ||
rt_sigpending | Returns a mask of outstanding signals | 127 | ||
rt_sigtimedwait | Interrupts the execution of a thread until certain signals arrive, with a time limit | 128 | ||
rt_sigqueueinfo | Sends signal and optionally data to a thread group; implements sigqueue and pthread_sigqueue | 129 | ||
rt_sigsuspend | Replaces the signal mask of the calling process and interrupts it | 130 | ||
sigaltstack | Returns a signal stack or creates a new one | 131 | ||
utime | Changes the timestamp of a file | 132 | ||
mknod | Creates a new entry in the file system | 133 | ||
uselib | Loads a dynamic library | 134 | ||
personality | Changes the execution domain | 135 | ||
ustat | Returns information about a mounted file system in a ustat structure | 136 | ||
statfs | Returns statistics on a file system referenced by a path | 137 | ||
fstatfs | Like statfs , but referencing via descriptor | 138 | ||
sysfs | Returns information about the file systems known to the kernel | 139 | ||
getpriority | Specifies the process priority back | 140 | ||
setpriority | Changes the process priority | 141 | ||
sched_setparam | Changes the scheduling parameters of a process | 142 | ||
sched_getparam | Returns the scheduling parameters of a process | 143 | ||
sched_setscheduler | Changes the scheduling parameters and policy of a thread | 144 | ||
sched_getscheduler | Returns the scheduling policy of a thread | 145 | ||
sched_get_priority_max | Specifies the max. possible priority | 146 | ||
sched_get_priority_min | Returns the min. possible priority | 147 | ||
sched_rr_get_interval | Returns the current SCHED_RR interval of a process | 148 | ||
mlock | Locks part of the virtual address space of the calling process to prevent it from being swapped out | 149 | ||
munlock | Unlocks pages protected with mlock | 150 | ||
mlockall | Like mlock , but protects the entire virtual address space of the process | 151 | ||
munlockall | Unlocks all pages protected with mlock | 152 | ||
vhangup | Simulates a hangup of the current terminal | 153 | ||
modify_ldt | Reads from or writes to the Local descriptor table (LDT) | 154 | ||
pivot_root | Moves the file system root of the current process | 155 | ||
_sysctl | Reads or sets kernel parameters | 156 | ||
prctl | Offers different process control functions | 157 | ||
arch_prctl | Changes architecture-specific process parameters | 158 | ||
adjtimex | Reads and sets kernel clock settings | 159 | ||
setrlimit | Sets resource limits | 160 | ||
chroot | Changes the root directory of the calling process according to the transferred path | 161 | ||
sync | Causes all buffered changes to metadata and files to be written to the intended storage media ( flushing ) | 162 | ||
acct | Activates or deactivates process accounting | 163 | ||
settimeofday | Changes the time or time zone | 164 | ||
mount | Mounts a specified file system in a target directory | 165 | ||
umount2 | Unmounts a mounted file system, allows options to be specified | 166 | ||
swapon | Designates a specified file or a block-oriented device as a swap area for the main memory | 167 | ||
swapoff | Ends the swapping of main memory areas into a specified file or a block-oriented device | 168 | ||
reboot | Restarts the system or activates / deactivates the keystroke for the restart (e.g. Ctrl-Alt-Del) | 169 | ||
sethostname | Changes the host name | 170 | ||
setdomainname | Changes the NIS domain | 171 | ||
iopl | Sets the I / O rights of a process | 172 | ||
ioperm | sets the access rights for ports | 173 | ||
create_module | Creates a kernel module entry and reserves memory required for a module | 174 | ||
init_module | Loads a kernel module | 175 | ||
delete_module | Removes a kernel module entry that is no longer required | 176 | ||
get_kernel_syms | Returns a table of exported kernel symbols | 177 | ||
query_module | Allows kernel queries via modules | 178 | ||
quotactl | Manages disk quota | 179 | ||
nfsservctl | Control of the NFS demon | 180 | ||
getpmsg | Unimplemented system call | 181 | ||
putpmsg | Unimplemented system call | 182 | ||
afs_syscall | Unimplemented system call | 183 | ||
tuxcall | Unimplemented system call, always returns −1 | 184 | ||
security | Unimplemented system call, always returns −1 | 185 | ||
gettid | Returns the ID of a thread . If a process has only one thread, the process identifier (PID) is returned. | 186 | ||
readahead | Reads file in advance into the page cache | 187 | ||
setxattr | Sets extended file attributes , file is identified by path | 188 | ||
lsetxattr | Sets extended file attributes of a symbolic link | 189 | ||
fsetxattr | Sets extended file attributes, file is identified by file descriptor | 190 | ||
getxattr | Reads extended file attributes | 191 | ||
lgetxattr | 192 | |||
fgetxattr | 193 | |||
listxattr | Lists extended file attributes | 194 | ||
llistxattr | 195 | |||
flistxattr | 196 | |||
removexattr | Removes an extended file attribute | 197 | ||
lremovexattr | 198 | |||
Fremdovexattr | 199 | |||
tkill | Sends a signal to a thread | 200 | ||
time | Time | 201 | ||
futex | Futex , a locking mechanism | 202 | ||
sched_setaffinity | Determines whether and / or which CPU cores are preferred by a thread ( affinity mask ) | 203 | ||
sched_getaffinity | Queries affinity mask | 204 | ||
set_thread_area | Creates a thread local storage (TLS) area | 205 | ||
io_setup | Creates a context for asynchronous communication ( asynchronous I / O ) | 206 | ||
io_destroy | Destroys a context for asynchronous communication | 207 | ||
io_getevents | Reads asynchronous I / O events from the completion queue | 208 | ||
io_submit | Submits an asynchronous I / O block for processing | 209 | ||
io_cancel | Cancels a pending asynchronous I / O operation | 210 | ||
get_thread_area | Outputs the entry point of a TLS area | 211 | ||
lookup_dcookie | 212 | |||
epoll_create | Creates an epoll file descriptor | 213 | ||
epoll_ctl_old | 214 | |||
epoll_wait_old | 215 | |||
remap_file_pages | 216 | |||
getdents64 | 217 | |||
set_tid_address | 218 | |||
restart_syscall | 219 | |||
semtimedop | 220 | |||
fadvise64 | 221 | |||
timer_create | 222 | |||
timer_settime | 223 | |||
timer_gettime | 224 | |||
timer_getoverrun | 225 | |||
timer_delete | 226 | |||
clock_settime | 227 | |||
clock_gettime | 228 | |||
clock_getres | 229 | |||
clock_nanosleep | 230 | |||
exit_group | 231 | |||
epoll_wait | 232 | |||
epoll_ctl | 233 | |||
tgkill | Sends a signal to a thread | 234 | ||
utimes | Changes file access and modification stamps | 235 | ||
vserver | Unimplemented system call | 236 | ||
mbind | Set NUMA policy for a memory area | 237 | ||
set_mempolicy | Sets the NUMA default for a thread and its children | 238 | ||
get_mempolicy | Returns the NUMA policy of a thread | 239 | ||
mq_open | Opens a message queue | 240 | ||
mq_unlink | Discards a message queue | 241 | ||
mq_timedsend | Sends a message to a message queue | 242 | ||
mq_timedreceive | Retrieves a message from a message queue | 243 | ||
mq_notify | Activates notification when there is a message in a message queue | 244 | ||
mq_getsetattr | Returns or changes the attributes of a message queue | 245 | ||
kexec_load | Loads a new kernel for later execution | 246 | ||
waitid | Wait until a child process terminates | 247 | ||
add_key | Adds a key to the key management of the kernel | 248 | ||
request_key | Retrieves a key from the kernel's key management system | 249 | ||
keyctl | Control functions for the kernel key management | 250 | ||
ioprio_set | Gets or changes the I / O scheduling class and priority | 251 | ||
ioprio_get | 252 | |||
inotify_init | Initializes an Inotify instance
|
253 | ||
inotify_add_watch | Adds a Inotify watch to an instance or discards one
|
254 | ||
inotify_rm_watch | 255 | |||
migrate_pages | Moves memory pages e.g. B. to another process | 256 | ||
openat | Opens file relative to a directory descriptor | 257 | ||
mkdirat | Creates directory relative to a directory descriptor | 258 | ||
mknodat | Like mknod, but interprets path information differently | 259 | ||
fchownat | Like chown, but interprets paths differently | 260 | ||
futimesat | Changes timestamps of files relative to directory descriptors (obsolete, utimesat bev.) | 261 | ||
newfstatat | 262 | |||
unlinked | Like unlink or rmdir, but interprets path information differently | 263 | ||
renameat | Like rename, but interprets path information differently | 264 | ||
linkat | Like link, but interprets path information differently | 265 | ||
symlinkat | Like symlink, but interprets path information differently | 266 | ||
readlinkat | Like readlink, but interprets path information differently | 267 | ||
fchmodat | Changes file permissions using a file descriptor | 268 | ||
faccessat | Like access, but interprets path information differently | 269 | ||
pselect | Assigns a monitoring routine to file descriptors, which informs about I / O events | 270 | ||
ppoll | Like poll, but waits for availabilities or signals | 271 | ||
unshare | Separates execution contexts shared with another process after a clone () and creates real copies | 272 | ||
set_robust_list | Adds a robust Futex added | 273 | ||
get_robust_list | Queries a list of robust futexes | 274 | ||
splice | Moves data between a file descriptor and a pipe without going through userspace | 275 | ||
tea | Doubles a pipe | 276 | ||
sync_file_range | Synchronizes open file with its physical copy | 277 | ||
vmsplice | Moves a page of memory to a pipe | 278 | ||
move_pages | Moves memory pages (NUMA) | 279 | ||
utimensat | Updates the timestamp of a file with high precision | 280 | ||
epoll_pwait | Like epoll_wait, but waiting for availabilities or signals | 281 | ||
signalfd | Creates a file descriptor that receives signals | 282 | ||
timerfd_create | Creates a file descriptor that references a timer | 283 | ||
eventfd | Creates a file descriptor that informs about events | 284 | ||
fallocate | Manipulates memory areas directly using a descriptor | 285 | ||
timerfd_settime | Controls timers via file descriptor | 286 | ||
timerfd_gettime | Returns time parameters of a timer via the file descriptor | 287 | ||
accept4 | Like accept, but accepts flags | 288 | ||
signalfd4 | 289 | |||
eventfd2 | 290 | |||
epoll_create1 | 291 | |||
dup3 | 292 | |||
pipe2 | 293 | |||
inotify_init1 | 294 | |||
preadv | Like readv, but allows an offset to be specified | 295 | ||
pwritev | Like writev, but allows an offset to be specified | 296 | ||
rt_tgsigqueueinfo | 297 | |||
perf_event_open | 298 | |||
recvmmsg | Like recvmsg, but allows multiple messages to be received with one call | 299 | ||
fanotify_init | Creates a fanotify notification group | 300 | ||
fanotify_mark | Adds or removes files and folders from a notification group | 301 | ||
prlimit64 | Sets resource limits for processes | 302 | ||
name_to_handle_at | Together like openat | 303 | ||
open_by_handle_at | 304 | |||
clock_adjtime | 305 | |||
syncfs | Writes the contents of the file system buffer to the disk | 306 | ||
sendmmsg | Like sendmsg, but allows multiple messages to be sent per call | 307 | ||
setns | Reassociates a thread with a namespace | 308 | ||
getcpu | Returns the processor on which a process (or thread) is currently running | 309 | ||
process_vm_readv | Moves data between process address spaces | 310 | ||
process_vm_writev | 311 | |||
kcmp | Determines whether the resources of two processes are the same | 312 | ||
finit_module | Loads a kernel module from a file descriptor fd | 313 | ||
sched_setattr | Defines a scheduling procedure (e.g. round robin ) | 314 | ||
sched_getattr | Determines the scheduling method used | 315 | ||
renameat2 | Atomic renaming of a file | 316 | ||
seccomp | Sandboxing mechanism ( secure computing mode ) | 317 | ||
trandom | Fills a buffer with high quality entropy | 318 | ||
memfd_create | Creates a file descriptor for an anonymous memory area (without the need for a tmpfs - Mount Points ) | 319 | ||
kexec_file_load | Loads a signed kernel image | 320 | ||
bpf | Berkeley Packet Filters | 321 | ||
execveat | Loads and starts the contents of an executable file relative to a directory descriptor | 322 | ||
userfaultfd | 323 | |||
membarrier | Storage barriers | 324 | ||
mlock2 | like mlock , but with flags | 325 | ||
copy_file_range | Allows quick copying of files | 326 | ||
preadv2 | like preadv , but with flags | 327 | ||
pwritev2 | like pwritev , but with flags | 328 |
literature
- Michael Kerrisk: The Linux Programming Interface. No Starch Press, San Francisco 2010, ISBN 978-1-59327-220-3 .
Individual evidence
- ↑ Always up-to-date list from Marcin Juszkiewicz
- ↑ How do I become a UNIX guru? by Arnold Willemer
- ↑ Memory Mapped Files
- ↑ a b http://man7.org/linux/man-pages/man2/init_module.2.html
- ↑ https://www.kernel.org/doc/Documentation/robust-futexes.txt
- ^ Preparing for user-space checkpoint / restore , LWN
- ↑ Loading modules from file descriptors , LWN
- ↑ a b http://man7.org/linux/man-pages/man2/sched_setattr.2.html
- ↑ Exchanging two files , LWN
- ↑ seccomp: add "seccomp" syscall
- ↑ [PATCH, RFC] random: introduce Getrandom (2) system call ( memento of the original from September 1, 2017 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.
- ↑ David Herrmann: memfd_create (2) , June 10, 2014
- ↑ Linux 3.17 Lands Memfd, A KDBUS Prerequisite , August 19, 2014
- ↑ kexec: A new system call to allow in kernel loading (V4) , June 26, 2014
- ↑ The BPF system call API, version 14 , LWN, September 24, 2014
- ↑ syscalls, x86, sparc: Add execveat () system call , LWN, November 14, 2014
- ↑ syscalls, x86: Add execveat () system call (v3) , September 12, 2012
- ↑ http://man7.org/linux/man-pages/man2/membarrier.2.html
- ↑ deferred memory locking LWN, July 8, 2015
- ↑ copy_file_range () , LWN, October 7, 2015
- ↑ a b The return of preadv2 () / pwritev2 () , LWN, January 6, 2016