from small one page howto to huge articles all in one place
Last additions:
May 25th. 2007:
April, 26th. 2006:
|
You are here: manpages
syscalls
Section: System Calls (2) Updated: 202-0-08 Index
Return to Main Contents
NAME
syscalls - Linux system calls
SYNOPSIS
Linux system calls.
DESCRIPTION
The system call is the fundamental interface between an application
and the Linux kernel.
System calls and library wrapper functions
System calls are generally not invoked directly,
but rather via wrapper functions in glibc (or perhaps some other library).
For details of direct invocation of a system call, see
intro(2).
Often, but not always, the name of the wrapper function is the same
as the name of the system call that it invokes.
For example, glibc contains a function
chdir()
which invokes the underlying "chdir" system call.
Often the glibc wrapper function is quite thin, doing little work
other than copying arguments to the right registers
before invoking the system call,
and then setting
errno
appropriately after the system call has returned.
(These are the same steps that are performed by
syscall(2),
which can be used to invoke system calls
for which no wrapper function is provided.)
Note: system calls indicate a failure by returning a negative error
number to the caller on architectures without a separate error register/flag,
as noted in
syscall(2);
when this happens,
the wrapper function negates the returned error number
(to make it positive), copies it to
errno,
and returns -1 to the caller of the wrapper.
Sometimes, however, the wrapper function does some extra work
before invoking the system call.
For example, nowadays there are (for reasons described below) two
related system calls,
truncate(2)
and
truncate64(2),
and the glibc
truncate()
wrapper function checks which of those system calls
are provided by the kernel and determines which should be employed.
System call list
Below is a list of the Linux system calls.
In the list, the
Kernel
column indicates the kernel version
for those system calls that were new in Linux 2.2,
or have appeared since that kernel version.
Note the following points:
- [bu]
-
Where no kernel version is indicated,
the system call appeared in Linux 1.0 or earlier.
- [bu]
-
Where a system call is marked "1.2"
this means the system call probably appeared in a Linux 1.1.x kernel version,
and first appeared in a stable kernel with 1.2.
(Development of the Linux 1.2 kernel was initiated from a branch of
Linux 1.0.6 via the Linux 1.1.x unstable kernel series.)
- [bu]
-
Where a system call is marked "2.0"
this means the system call probably appeared in a Linux 1.3.x kernel version,
and first appeared in a stable kernel with Linux 2.0.
(Development of the Linux 2.0 kernel was initiated from a branch of
Linux 1.2.x, somewhere around Linux 1.2.10,
via the Linux 1.3.x unstable kernel series.)
- [bu]
-
Where a system call is marked "2.2"
this means the system call probably appeared in a Linux 2.1.x kernel version,
and first appeared in a stable kernel with Linux 2.2.0.
(Development of the Linux 2.2 kernel was initiated from a branch of
Linux 2.0.21 via the Linux 2.1.x unstable kernel series.)
- [bu]
-
Where a system call is marked "2.4"
this means the system call probably appeared in a Linux 2.3.x kernel version,
and first appeared in a stable kernel with Linux 2.4.0.
(Development of the Linux 2.4 kernel was initiated from a branch of
Linux 2.2.8 via the Linux 2.3.x unstable kernel series.)
- [bu]
-
Where a system call is marked "2.6"
this means the system call probably appeared in a Linux 2.5.x kernel version,
and first appeared in a stable kernel with Linux 2.6.0.
(Development of Linux 2.6 was initiated from a branch
of Linux 2.4.15 via the Linux 2.5.x unstable kernel series.)
- [bu]
-
Starting with Linux 2.6.0, the development model changed,
and new system calls may appear in each Linux 2.6.x release.
In this case, the exact version number where the system call appeared
is shown.
This convention continues
with the Linux 3.x kernel series,
which followed on from Linux 2.6.39;
and the Linux 4.x kernel series,
which followed on from Linux 3.19;
and the Linux 5.x kernel series,
which followed on from Linux 4.20;
and the Linux 6.x kernel series,
which followed on from Linux 5.19.
- [bu]
-
In some cases, a system call was added to a stable kernel
series after it branched from the previous stable kernel
series, and then backported into the earlier stable kernel series.
For example some system calls that appeared in Linux 2.6.x were also backported
into a Linux 2.4.x release after Linux 2.4.15.
When this is so, the version where the system call appeared
in both of the major kernel series is listed.
The list of system calls that are available as at Linux 5.14
(or in a few cases only on older kernels) is as follows:
| System call | Kernel | Notes
|
|
| B]_llseek](2) | 1.2 |
|
| B]_newselect](2) | 2.0 |
|
| B]_sysctl](2) | 2.0 | Removed in 5.5
|
|
accept(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]accept4](2) | 2.6.28 |
|
| B]access](2) | 1.0 |
|
| B]acct](2) | 1.0 |
|
| B]add_key](2) | 2.6.10 |
|
| B]adjtimex](2) | 1.0 |
|
| B]alarm](2) | 1.0 |
|
| B]alloc_hugepages](2) | 2.5.36 | Removed in 2.5.44
|
| B]arc_gettls](2) | 3.9 | ARC only
|
| B]arc_settls](2) | 3.9 | ARC only
|
| B]arc_usr_cmpxchg](2) | 4.9 | ARC only
|
|
arch_prctl(2)
| 2.6 |
x86_64, x86 since 4.12
|
| B]atomic_barrier](2) | 2.6.34 | m68k only
|
| B]atomic_cmpxchg_32](2) | 2.6.34 | m68k only
|
|
bdflush(2)
| 1.2 |
Deprecated (does nothing)
since 2.6,
removed in 5.15
|
|
bind(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]bpf](2) | 3.18 |
|
| B]brk](2) | 1.0 |
|
|
breakpoint(2)
| 2.2 |
ARM OABI only, defined with
B]__ARM_NR] prefix
|
| B]cacheflush](2) | 1.2 | Not on x86
|
| B]capget](2) | 2.2 |
|
| B]capset](2) | 2.2 |
|
| B]chdir](2) | 1.0 |
|
| B]chmod](2) | 1.0 |
|
|
chown(2)
| 2.2 |
See
chown(2)
for
version details
|
| B]chown32](2) | 2.4 |
|
| B]chroot](2) | 1.0 |
|
| B]clock_adjtime](2) | 2.6.39 |
|
| B]clock_getres](2) | 2.6 |
|
| B]clock_gettime](2) | 2.6 |
|
| B]clock_nanosleep](2) | 2.6 |
|
| B]clock_settime](2) | 2.6 |
|
| B]clone2](2) | 2.4 | I-64 only
|
| B]clone](2) | 1.0 |
|
| B]clone3](2) | 5.3 |
|
| B]close](2) | 1.0 |
|
| B]close_range](2) | 5.9 |
|
|
connect(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]copy_file_range](2) | 4.5 |
|
| B]creat](2) | 1.0 |
|
| B]create_module](2) | 1.0 | Removed in 2.6
|
| B]delete_module](2) | 1.0 |
|
| B]dup](2) | 1.0 |
|
| B]dup2](2) | 1.0 |
|
| B]dup3](2) | 2.6.27 |
|
| B]epoll_create](2) | 2.6 |
|
| B]epoll_create1](2) | 2.6.27 |
|
| B]epoll_ctl](2) | 2.6 |
|
| B]epoll_pwait](2) | 2.6.19 |
|
| B]epoll_pwait2](2) | 5.11 |
|
| B]epoll_wait](2) | 2.6 |
|
| B]eventfd](2) | 2.6.22 |
|
| B]eventfd2](2) | 2.6.27 |
|
|
execv(2)
| 2.0 |
SPARC/SPARC64 only, for
compatibility with SunOS
|
| B]execve](2) | 1.0 |
|
| B]execveat](2) | 3.19 |
|
| B]exit](2) | 1.0 |
|
| B]exit_group](2) | 2.6 |
|
| B]faccessat](2) | 2.6.16 |
|
| B]faccessat2](2) | 5.8 |
|
| B]fadvise64](2) | 2.6 |
|
| B]fadvise64_64](2) | 2.6 |
|
| B]fallocate](2) | 2.6.23 |
|
| B]fanotify_init](2) | 2.6.37 |
|
| B]fanotify_mark](2) | 2.6.37 |
|
| B]fchdir](2) | 1.0 |
|
| B]fchmod](2) | 1.0 |
|
| B]fchmodat](2) | 2.6.16 |
|
| B]fchown](2) | 1.0 |
|
| B]fchown32](2) | 2.4 |
|
| B]fchownat](2) | 2.6.16 |
|
| B]fcntl](2) | 1.0 |
|
| B]fcntl64](2) | 2.4 |
|
| B]fdatasync](2) | 2.0 |
|
| B]fgetxattr](2) | 2.6; 2.4.18 |
|
| B]finit_module](2) | 3.8 |
|
| B]flistxattr](2) | 2.6; 2.4.18 |
|
| B]flock](2) | 2.0 |
|
| B]fork](2) | 1.0 |
|
| B]free_hugepages](2) | 2.5.36 | Removed in 2.5.44
|
| B]fremovexattr](2) | 2.6; 2.4.18 |
|
| B]fsconfig](2) | 5.2 |
|
| B]fsetxattr](2) | 2.6; 2.4.18 |
|
| B]fsmount](2) | 5.2 |
|
| B]fsopen](2) | 5.2 |
|
| B]fspick](2) | 5.2 |
|
| B]fstat](2) | 1.0 |
|
| B]fstat64](2) | 2.4 |
|
| B]fstatat64](2) | 2.6.16 |
|
| B]fstatfs](2) | 1.0 |
|
| B]fstatfs64](2) | 2.6 |
|
| B]fsync](2) | 1.0 |
|
| B]ftruncate](2) | 1.0 |
|
| B]ftruncate64](2) | 2.4 |
|
| B]futex](2) | 2.6 |
|
| B]futimesat](2) | 2.6.16 |
|
| B]get_kernel_syms](2) | 1.0 | Removed in 2.6
|
| B]get_mempolicy](2) | 2.6.6 |
|
| B]get_robust_list](2) | 2.6.17 |
|
| B]get_thread_area](2) | 2.6 |
|
|
get_tls(2)
| 4.15 |
ARM OABI only, has
B]__ARM_NR] prefix
|
| B]getcpu](2) | 2.6.19 |
|
| B]getcwd](2) | 2.2 |
|
| B]getdents](2) | 2.0 |
|
| B]getdents64](2) | 2.4 |
|
|
getdomainname(2)
| 2.2 |
SPARC, SPARC64;
available as B]osf_getdomainname](2)
on Alpha since Linux 2.0
|
|
getdtablesize(2)
| 2.0 |
SPARC (removed in 2.6.26),
available on Alpha as
B]osf_getdtablesize](2)
|
| B]getegid](2) | 1.0 |
|
| B]getegid32](2) | 2.4 |
|
| B]geteuid](2) | 1.0 |
|
| B]geteuid32](2) | 2.4 |
|
| B]getgid](2) | 1.0 |
|
| B]getgid32](2) | 2.4 |
|
| B]getgroups](2) | 1.0 |
|
| B]getgroups32](2) | 2.4 |
|
|
gethostname(2)
| 2.0 |
Alpha, was available on
SPARC up to Linux 2.6.26
|
| B]getitimer](2) | 1.0 |
|
|
getpeername(2)
| 2.0 |
See notes on B]socketcall](2)
|
|
getpagesize(2)
| 2.0 |
Alpha, SPARC/SPARC64 only
|
| B]getpgid](2) | 1.0 |
|
| B]getpgrp](2) | 1.0 |
|
| B]getpid](2) | 1.0 |
|
| B]getppid](2) | 1.0 |
|
| B]getpriority](2) | 1.0 |
|
| B]getrandom](2) | 3.17 |
|
| B]getresgid](2) | 2.2 |
|
| B]getresgid32](2) | 2.4 |
|
| B]getresuid](2) | 2.2 |
|
| B]getresuid32](2) | 2.4 |
|
| B]getrlimit](2) | 1.0 |
|
| B]getrusage](2) | 1.0 |
|
| B]getsid](2) | 2.0 |
|
|
getsockname(2)
| 2.0 |
See notes on B]socketcall](2)
|
|
getsockopt(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]gettid](2) | 2.4.11 |
|
| B]gettimeofday](2) | 1.0 |
|
| B]getuid](2) | 1.0 |
|
| B]getuid32](2) | 2.4 |
|
|
getunwind(2)
| 2.4.8 |
I-64 only;
deprecated
|
| B]getxattr](2) | 2.6; 2.4.18 |
|
|
getxgid(2)
| 2.0 |
Alpha only;
see NOTES
|
|
getxpid(2)
| 2.0 |
Alpha only;
see NOTES
|
|
getxuid(2)
| 2.0 |
Alpha only;
see NOTES
|
| B]init_module](2) | 1.0 |
|
| B]inotify_add_watch](2) | 2.6.13 |
|
| B]inotify_init](2) | 2.6.13 |
|
| B]inotify_init1](2) | 2.6.27 |
|
| B]inotify_rm_watch](2) | 2.6.13 |
|
| B]io_cancel](2) | 2.6 |
|
| B]io_destroy](2) | 2.6 |
|
| B]io_getevents](2) | 2.6 |
|
| B]io_pgetevents](2) | 4.18 |
|
| B]io_setup](2) | 2.6 |
|
| B]io_submit](2) | 2.6 |
|
| B]io_uring_enter](2) | 5.1 |
|
| B]io_uring_register](2) | 5.1 |
|
| B]io_uring_setup](2) | 5.1 |
|
| B]ioctl](2) | 1.0 |
|
| B]ioperm](2) | 1.0 |
|
| B]iopl](2) | 1.0 |
|
| B]ioprio_get](2) | 2.6.13 |
|
| B]ioprio_set](2) | 2.6.13 |
|
| B]ipc](2) | 1.0 |
|
| B]kcmp](2) | 3.5 |
|
| B]kern_features](2) | 3.7 | SPARC64 only
|
| B]kexec_file_load](2) | 3.17 |
|
| B]kexec_load](2) | 2.6.13 |
|
| B]keyctl](2) | 2.6.10 |
|
| B]kill](2) | 1.0 |
|
| B]landlock_add_rule](2) | 5.13 |
|
| B]landlock_create_ruleset](2) | 5.13 |
|
| B]landlock_restrict_self](2) | 5.13 |
|
|
lchown(2)
| 1.0 |
See
chown(2)
for
version details
|
| B]lchown32](2) | 2.4 |
|
| B]lgetxattr](2) | 2.6; 2.4.18 |
|
| B]link](2) | 1.0 |
|
| B]linkat](2) | 2.6.16 |
|
|
listen(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]listxattr](2) | 2.6; 2.4.18 |
|
| B]llistxattr](2) | 2.6; 2.4.18 |
|
| B]lookup_dcookie](2) | 2.6 |
|
| B]lremovexattr](2) | 2.6; 2.4.18 |
|
| B]lseek](2) | 1.0 |
|
| B]lsetxattr](2) | 2.6; 2.4.18 |
|
| B]lstat](2) | 1.0 |
|
| B]lstat64](2) | 2.4 |
|
| B]madvise](2) | 2.4 |
|
| B]mbind](2) | 2.6.6 |
|
| B]memory_ordering](2) | 2.2 | SPARC64 only
|
| B]membarrier](2) | 3.17 |
|
| B]memfd_create](2) | 3.17 |
|
| B]memfd_secret](2) | 5.14 |
|
| B]migrate_pages](2) | 2.6.16 |
|
| B]mincore](2) | 2.4 |
|
| B]mkdir](2) | 1.0 |
|
| B]mkdirat](2) | 2.6.16 |
|
| B]mknod](2) | 1.0 |
|
| B]mknodat](2) | 2.6.16 |
|
| B]mlock](2) | 2.0 |
|
| B]mlock2](2) | 4.4 |
|
| B]mlockall](2) | 2.0 |
|
| B]mmap](2) | 1.0 |
|
| B]mmap2](2) | 2.4 |
|
| B]modify_ldt](2) | 1.0 |
|
| B]mount](2) | 1.0 |
|
| B]move_mount](2) | 5.2 |
|
| B]move_pages](2) | 2.6.18 |
|
| B]mprotect](2) | 1.0 |
|
| B]mq_getsetattr](2) | 2.6.6 |
|
| B]mq_notify](2) | 2.6.6 |
|
| B]mq_open](2) | 2.6.6 |
|
| B]mq_timedreceive](2) | 2.6.6 |
|
| B]mq_timedsend](2) | 2.6.6 |
|
| B]mq_unlink](2) | 2.6.6 |
|
| B]mremap](2) | 2.0 |
|
|
msgctl(2)
| 2.0 |
See notes on B]ipc](2)
|
|
msgget(2)
| 2.0 |
See notes on B]ipc](2)
|
|
msgrcv(2)
| 2.0 |
See notes on B]ipc](2)
|
|
msgsnd(2)
| 2.0 |
See notes on B]ipc](2)
|
| B]msync](2) | 2.0 |
|
| B]munlock](2) | 2.0 |
|
| B]munlockall](2) | 2.0 |
|
| B]munmap](2) | 1.0 |
|
| B]name_to_handle_at](2) | 2.6.39 |
|
| B]nanosleep](2) | 2.0 |
|
|
newfstatat(2)
| 2.6.16 |
See B]stat](2)
|
| B]nfsservctl](2) | 2.2 | Removed in 3.1
|
| B]nice](2) | 1.0 |
|
|
old_adjtimex(2)
| 2.0 |
Alpha only;
see NOTES
|
|
old_getrlimit(2)
| 2.4 |
Old variant of B]getrlimit](2)
that used a different value
for B]RLIM_INFINITY]
|
| B]oldfstat](2) | 1.0 |
|
| B]oldlstat](2) | 1.0 |
|
| B]oldolduname](2) | 1.0 |
|
| B]oldstat](2) | 1.0 |
|
|
oldumount(2)
| 2.4.116 |
Name of the old B]umount](2)
syscall on Alpha
|
| B]olduname](2) | 1.0 |
|
| B]open](2) | 1.0 |
|
| B]open_by_handle_at](2) | 2.6.39 |
|
| B]open_tree](2) | 5.2 |
|
| B]openat](2) | 2.6.16 |
|
| B]openat2](2) | 5.6 |
|
|
or1k_atomic(2)
| 3.1 |
OpenRISC 1000 only
|
| B]pause](2) | 1.0 |
|
| B]pciconfig_iobase](2) | 2.2.15; 2.4 | Not on x86
|
| B]pciconfig_read](2) | 2.0.26; 2.2 | Not on x86
|
| B]pciconfig_write](2) | 2.0.26; 2.2 | Not on x86
|
|
perf_event_open(2)
| 2.6.31 |
Was perf_counter_open() in 2.6.31;
renamed in 2.6.32
|
| B]personality](2) | 1.2 |
|
|
perfctr(2)
| 2.2 |
SPARC only;
removed in 2.6.34
|
| B]perfmonctl](2) | 2.4 | I-64 only; removed in 5.10
|
| B]pidfd_getfd](2) | 5.6 |
|
| B]pidfd_send_signal](2) | 5.1 |
|
| B]pidfd_open](2) | 5.3 |
|
| B]pipe](2) | 1.0 |
|
| B]pipe2](2) | 2.6.27 |
|
| B]pivot_root](2) | 2.4 |
|
| B]pkey_alloc](2) | 4.8 |
|
| B]pkey_free](2) | 4.8 |
|
| B]pkey_mprotect](2) | 4.8 |
|
| B]poll](2) | 2.0.36; 2.2 |
|
| B]ppoll](2) | 2.6.16 |
|
| B]prctl](2) | 2.2 |
|
|
pread64(2)
| |
Added as "pread" in 2.2;
renamed "pread64" in 2.6
|
| B]preadv](2) | 2.6.30 |
|
| B]preadv2](2) | 4.6 |
|
| B]prlimit64](2) | 2.6.36 |
|
| B]process_madvise](2) | 5.10 |
|
| B]process_vm_readv](2) | 3.2 |
|
| B]process_vm_writev](2) | 3.2 |
|
| B]pselect6](2) | 2.6.16 |
|
| B]ptrace](2) | 1.0 |
|
|
pwrite64(2)
| |
Added as "pwrite" in 2.2;
renamed "pwrite64" in 2.6
|
| B]pwritev](2) | 2.6.30 |
|
| B]pwritev2](2) | 4.6 |
|
| B]query_module](2) | 2.2 | Removed in 2.6
|
| B]quotactl](2) | 1.0 |
|
| B]quotactl_fd](2) | 5.14 |
|
| B]read](2) | 1.0 |
|
| B]readahead](2) | 2.4.13 |
|
| B]readdir](2) | 1.0 |
|
| B]readlink](2) | 1.0 |
|
| B]readlinkat](2) | 2.6.16 |
|
| B]readv](2) | 2.0 |
|
| B]reboot](2) | 1.0 |
|
|
recv(2)
| 2.0 |
See notes on B]socketcall](2)
|
|
recvfrom(2)
| 2.0 |
See notes on B]socketcall](2)
|
|
recvmsg(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]recvmmsg](2) | 2.6.33 |
|
|
remap_file_pages(2)
| 2.6 |
Deprecated since 3.16
|
| B]removexattr](2) | 2.6; 2.4.18 |
|
| B]rename](2) | 1.0 |
|
| B]renameat](2) | 2.6.16 |
|
| B]renameat2](2) | 3.15 |
|
| B]request_key](2) | 2.6.10 |
|
| B]restart_syscall](2) | 2.6 |
|
| B]riscv_flush_icache](2) | 4.15 | RIS-V only
|
| B]rmdir](2) | 1.0 |
|
| B]rseq](2) | 4.18 |
|
| B]rt_sigaction](2) | 2.2 |
|
| B]rt_sigpending](2) | 2.2 |
|
| B]rt_sigprocmask](2) | 2.2 |
|
| B]rt_sigqueueinfo](2) | 2.2 |
|
| B]rt_sigreturn](2) | 2.2 |
|
| B]rt_sigsuspend](2) | 2.2 |
|
| B]rt_sigtimedwait](2) | 2.2 |
|
| B]rt_tgsigqueueinfo](2) | 2.6.31 |
|
|
rtas(2)
| 2.6.2 |
PowerPC/PowerPC64 only
|
| B]s390_runtime_instr](2) | 3.7 | s390 only
|
| B]s390_pci_mmio_read](2) | 3.19 | s390 only
|
| B]s390_pci_mmio_write](2) | 3.19 | s390 only
|
| B]s390_sthyi](2) | 4.15 | s390 only
|
| B]s390_guarded_storage](2) | 4.12 | s390 only
|
|
sched_get_affinity(2)
| 2.6 |
Name of
sched_getaffinity(2)
on SPARC and SPARC64
|
| B]sched_get_priority_max](2) | 2.0 |
|
| B]sched_get_priority_min](2) | 2.0 |
|
| B]sched_getaffinity](2) | 2.6 |
|
| B]sched_getattr](2) | 3.14 |
|
| B]sched_getparam](2) | 2.0 |
|
| B]sched_getscheduler](2) | 2.0 |
|
| B]sched_rr_get_interval](2) | 2.0 |
|
|
sched_set_affinity(2)
| 2.6 |
Name of
sched_setaffinity(2)
on SPARC and SPARC64
|
| B]sched_setaffinity](2) | 2.6 |
|
| B]sched_setattr](2) | 3.14 |
|
| B]sched_setparam](2) | 2.0 |
|
| B]sched_setscheduler](2) | 2.0 |
|
| B]sched_yield](2) | 2.0 |
|
| B]seccomp](2) | 3.17 |
|
| B]select](2) | 1.0 |
|
|
semctl(2)
| 2.0 |
See notes on B]ipc](2)
|
|
semget(2)
| 2.0 |
See notes on B]ipc](2)
|
|
semop(2)
| 2.0 |
See notes on B]ipc](2)
|
| B]semtimedop](2) | 2.6; 2.4.22 |
|
|
send(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]sendfile](2) | 2.2 |
|
| B]sendfile64](2) | 2.6; 2.4.19 |
|
| B]sendmmsg](2) | 3.0 |
|
|
sendmsg(2)
| 2.0 |
See notes on B]socketcall](2)
|
|
sendto(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]set_mempolicy](2) | 2.6.6 |
|
| B]set_robust_list](2) | 2.6.17 |
|
| B]set_thread_area](2) | 2.6 |
|
| B]set_tid_address](2) | 2.6 |
|
|
set_tls(2)
| 2.6.11 |
ARM OABI/EABI only (constant
has B]__ARM_NR] prefix)
|
| B]setdomainname](2) | 1.0 |
|
| B]setfsgid](2) | 1.2 |
|
| B]setfsgid32](2) | 2.4 |
|
| B]setfsuid](2) | 1.2 |
|
| B]setfsuid32](2) | 2.4 |
|
| B]setgid](2) | 1.0 |
|
| B]setgid32](2) | 2.4 |
|
| B]setgroups](2) | 1.0 |
|
| B]setgroups32](2) | 2.4 |
|
|
sethae(2)
| 2.0 |
Alpha only;
see NOTES
|
| B]sethostname](2) | 1.0 |
|
| B]setitimer](2) | 1.0 |
|
| B]setns](2) | 3.0 |
|
| B]setpgid](2) | 1.0 |
|
|
setpgrp(2)
| 2.0 |
Alternative name for
setpgid(2)
on Alpha
|
| B]setpriority](2) | 1.0 |
|
| B]setregid](2) | 1.0 |
|
| B]setregid32](2) | 2.4 |
|
| B]setresgid](2) | 2.2 |
|
| B]setresgid32](2) | 2.4 |
|
| B]setresuid](2) | 2.2 |
|
| B]setresuid32](2) | 2.4 |
|
| B]setreuid](2) | 1.0 |
|
| B]setreuid32](2) | 2.4 |
|
| B]setrlimit](2) | 1.0 |
|
| B]setsid](2) | 1.0 |
|
|
setsockopt(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]settimeofday](2) | 1.0 |
|
| B]setuid](2) | 1.0 |
|
| B]setuid32](2) | 2.4 |
|
| B]setup](2) | 1.0 | Removed in 2.2
|
| B]setxattr](2) | 2.6; 2.4.18 |
|
| B]sgetmask](2) | 1.0 |
|
|
shmat(2)
| 2.0 |
See notes on B]ipc](2)
|
|
shmctl(2)
| 2.0 |
See notes on B]ipc](2)
|
|
shmdt(2)
| 2.0 |
See notes on B]ipc](2)
|
|
shmget(2)
| 2.0 |
See notes on B]ipc](2)
|
|
shutdown(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]sigaction](2) | 1.0 |
|
| B]sigaltstack](2) | 2.2 |
|
| B]signal](2) | 1.0 |
|
| B]signalfd](2) | 2.6.22 |
|
| B]signalfd4](2) | 2.6.27 |
|
| B]sigpending](2) | 1.0 |
|
| B]sigprocmask](2) | 1.0 |
|
| B]sigreturn](2) | 1.0 |
|
| B]sigsuspend](2) | 1.0 |
|
|
socket(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]socketcall](2) | 1.0 |
|
|
socketpair(2)
| 2.0 |
See notes on B]socketcall](2)
|
| B]spill](2) | 2.6.13 | Xtensa only
|
| B]splice](2) | 2.6.17 |
|
|
spu_create(2)
| 2.6.16 |
PowerPC/PowerPC64 only
|
|
spu_run(2)
| 2.6.16 |
PowerPC/PowerPC64 only
|
| B]ssetmask](2) | 1.0 |
|
| B]stat](2) | 1.0 |
|
| B]stat64](2) | 2.4 |
|
| B]statfs](2) | 1.0 |
|
| B]statfs64](2) | 2.6 |
|
| B]statx](2) | 4.11 |
|
| B]stime](2) | 1.0 |
|
|
subpage_prot(2)
| 2.6.25 |
PowerPC/PowerPC64 only
|
|
swapcontext(2)
| 2.6.3 |
PowerPC/PowerPC64 only
|
| B]switch_endian](2) | 4.1 | PowerPC64 only
|
| B]swapoff](2) | 1.0 |
|
| B]swapon](2) | 1.0 |
|
| B]symlink](2) | 1.0 |
|
| B]symlinkat](2) | 2.6.16 |
|
| B]sync](2) | 1.0 |
|
| B]sync_file_range](2) | 2.6.17 |
|
| B]sync_file_range2](2) | 2.6.22 |
|
| B]syncfs](2) | 2.6.39 |
|
| B]sys_debug_setcontext](2) | 2.6.11 | PowerPC only
|
|
syscall(2)
| 1.0 |
Still available on ARM OABI
and MIPS O32 ABI
|
| B]sysfs](2) | 1.2 |
|
| B]sysinfo](2) | 1.0 |
|
| B]syslog](2) | 1.0 |
|
| B]sysmips](2) | 2.6.0 | MIPS only
|
| B]tee](2) | 2.6.17 |
|
| B]tgkill](2) | 2.6 |
|
| B]time](2) | 1.0 |
|
| B]timer_create](2) | 2.6 |
|
| B]timer_delete](2) | 2.6 |
|
| B]timer_getoverrun](2) | 2.6 |
|
| B]timer_gettime](2) | 2.6 |
|
| B]timer_settime](2) | 2.6 |
|
| B]timerfd_create](2) | 2.6.25 |
|
| B]timerfd_gettime](2) | 2.6.25 |
|
| B]timerfd_settime](2) | 2.6.25 |
|
| B]times](2) | 1.0 |
|
| B]tkill](2) | 2.6; 2.4.22 |
|
| B]truncate](2) | 1.0 |
|
| B]truncate64](2) | 2.4 |
|
| B]ugetrlimit](2) | 2.4 |
|
| B]umask](2) | 1.0 |
|
| B]umount](2) | 1.0 |
|
| B]umount2](2) | 2.2 |
|
| B]uname](2) | 1.0 |
|
| B]unlink](2) | 1.0 |
|
| B]unlinkat](2) | 2.6.16 |
|
| B]unshare](2) | 2.6.16 |
|
| B]uselib](2) | 1.0 |
|
| B]ustat](2) | 1.0 |
|
| B]userfaultfd](2) | 4.3 |
|
| B]usr26](2) | 2.4.8.1 | ARM OABI only
|
| B]usr32](2) | 2.4.8.1 | ARM OABI only
|
| B]utime](2) | 1.0 |
|
| B]utimensat](2) | 2.6.22 |
|
| B]utimes](2) | 2.2 |
|
| B]utrap_install](2) | 2.2 | SPARC64 only
|
| B]vfork](2) | 2.2 |
|
| B]vhangup](2) | 1.0 |
|
|
vm86old(2)
| 1.0 |
Was "vm86";
renamed in 2.0.28/2.2
|
| B]vm86](2) | 2.0.28; 2.2 |
|
| B]vmsplice](2) | 2.6.17 |
|
| B]wait4](2) | 1.0 |
|
| B]waitid](2) | 2.6.10 |
|
| B]waitpid](2) | 1.0 |
|
| B]write](2) | 1.0 |
|
| B]writev](2) | 2.0 |
|
| B]xtensa](2) | 2.6.13 | Xtensa only
|
On many platforms, including x8-32, socket calls are all multiplexed
(via glibc wrapper functions) through
socketcall(2)
and similarly System V IPC calls are multiplexed through
ipc(2).
Although slots are reserved for them in the system call table,
the following system calls are not implemented in the standard kernel:
afs_syscall(2),
break(2),
ftime(2),
getpmsg(2),
gtty(2),
idle(2),
lock(2),
madvise1(2),
mpx(2),
phys(2),
prof(2),
profil(2),
putpmsg(2),
security(2),
stty(2),
tuxcall(2),
ulimit(2),
and
vserver(2)
(see also
unimplemented(2)).
However,
ftime(3),
profil(3),
and
ulimit(3)
exist as library routines.
The slot for
phys(2)
is in use since Linux 2.1.116 for
umount(2);
phys(2)
will never be implemented.
The
getpmsg(2)
and
putpmsg(2)
calls are for kernels patched to support STREAMS,
and may never be in the standard kernel.
There was briefly
set_zone_reclaim(2),
added in Linux 2.6.13, and removed in Linux 2.6.16;
this system call was never available to user space.
System calls on removed ports
Some system calls only ever existed on Linux architectures that have
since been removed from the kernel:
- Blackfin (port removed in Linux 4.17)
-
-
- [bu]
-
bfin_spinlock(2)
(added in Linux 2.6.22)
- [bu]
-
dma_memcpy(2)
(added in Linux 2.6.22)
- [bu]
-
sram_alloc(2)
(added in Linux 2.6.22)
- [bu]
-
sram_free(2)
(added in Linux 2.6.22)
- Metag (port removed in Linux 4.17)
-
-
- [bu]
-
metag_get_tls(2)
(add in Linux 3.9)
- [bu]
-
metag_set_fpu_flags(2)
(add in Linux 3.9)
- [bu]
-
metag_set_tls(2)
(add in Linux 3.9)
- [bu]
-
metag_setglobalbit(2)
(add in Linux 3.9)
- Tile (port removed in Linux 4.17)
-
-
- [bu]
-
cmpxchg_badaddr(2)
(added in Linux 2.6.36)
NOTES
Roughly speaking, the code belonging to the system call
with number __NR_xxx defined in
/usr/include/asm/unistd.h
can be found in the Linux kernel source in the routine
sys_xxx().
There are many exceptions, however, mostly because
older system calls were superseded by newer ones,
and this has been treated somewhat unsystematically.
On platforms with
proprietary operatin-system emulation,
such as sparc, sparc64, and alpha,
there are many additional system calls;
mips64 also contains a full set of
3-bit system calls.
Over time, changes to the interfaces of some system calls have been
necessary.
One reason for such changes was the need to increase the size of
structures or scalar values passed to the system call.
Because of these changes, certain architectures
(notably, longstanding 3-bit architectures such as i386)
now have various groups of related system calls (e.g.,
truncate(2)
and
truncate64(2))
which perform similar tasks, but which vary in
details such as the size of their arguments.
(As noted earlier, applications are generally unaware of this:
the glibc wrapper functions do some work to ensure that the right
system call is invoked, and that ABI compatibility is
preserved for old binaries.)
Examples of system calls that exist in multiple versions are
the following:
- [bu]
-
By now there are three different versions of
stat(2):
sys_stat()
(slot
__NR_oldstat),
sys_newstat()
(slot
__NR_stat),
and
sys_stat64()
(slot
__NR_stat64),
with the last being the most current.
A similar story applies for
lstat(2)
and
fstat(2).
- [bu]
-
Similarly, the defines
__NR_oldolduname,
__NR_olduname,
and
__NR_uname
refer to the routines
sys_olduname(),
sys_uname(),
and
sys_newuname().
- [bu]
-
In Linux 2.0, a new version of
vm86(2)
appeared, with the old and the new kernel routines being named
sys_vm86old()
and
sys_vm86().
- [bu]
-
In Linux 2.4, a new version of
getrlimit(2)
appeared, with the old and the new kernel routines being named
sys_old_getrlimit()
(slot
__NR_getrlimit)
and
sys_getrlimit()
(slot
__NR_ugetrlimit).
- [bu]
-
Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
To support this change, a range of system calls were added
(e.g.,
chown32(2),
getuid32(2),
getgroups32(2),
setresuid32(2)),
superseding earlier calls of the same name without the
"32" suffix.
- [bu]
-
Linux 2.4 added support for applications on 3-bit architectures
to access large files (i.e., files for which the sizes and
file offsets can't be represented in 32 bits.)
To support this change, replacements were required for system calls
that deal with file offsets and sizes.
Thus the following system calls were added:
fcntl64(2),
getdents64(2),
stat64(2),
statfs64(2),
truncate64(2),
and their analogs that work with file descriptors or
symbolic links.
These system calls supersede the older system calls
which, except in the case of the "stat" calls,
have the same name without the "64" suffix.
-
On newer platforms that only have 6-bit file access and 3-bit UIDs/GIDs
(e.g., alpha, ia64, s390x, x8-64), there is just a single version of
the UID/GID and file access system calls.
On platforms (typically, 3-bit platforms) where the *64 and *32 calls exist,
the other versions are obsolete.
- [bu]
-
The
rt_sig*
calls were added in Linux 2.2 to support the addition
of rea-time signals (see
signal(7)).
These system calls supersede the older system calls of the same
name without the "rt_" prefix.
- [bu]
-
The
select(2)
and
mmap(2)
system calls use five or more arguments,
which caused problems in the way
argument passing on the i386 used to be set up.
Thus, while other architectures have
sys_select()
and
sys_mmap()
corresponding to
__NR_select
and
__NR_mmap,
on i386 one finds
old_select()
and
old_mmap()
(routines that use a pointer to an
argument block) instead.
These days passing five arguments
is not a problem any more, and there is a
__NR__newselect
that corresponds directly to
sys_select()
and similarly
__NR_mmap2.
s390x is the only 6-bit architecture that has
old_mmap().
Architectur-specific details: Alpha
- getxgid(2)
-
returns a pair of GID and effective GID via registers
r0
and
r20;
it is provided
instead of
getgid(2)
and
getegid(2).
- getxpid(2)
-
returns a pair of PID and parent PID via registers
r0
and
r20;
it is provided instead of
getpid(2)
and
getppid(2).
- old_adjtimex(2)
-
is a variant of
adjtimex(2)
that uses
struct timeval32,
for compatibility with OSF/1.
- getxuid(2)
-
returns a pair of UID and effective UID via registers
r0
and
r20;
it is provided instead of
getuid(2)
and
geteuid(2).
- sethae(2)
-
is used for configuring the Host Address Extension register on
lo-cost Alphas in order to access address space beyond first 27 bits.
SEE ALSO
intro(2),
syscall(2),
unimplemented(2),
errno(3),
libc(7),
vdso(7),
ausyscall(8)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- System calls and library wrapper functions
-
- System call list
-
- System calls on removed ports
-
- NOTES
-
- Architecture-specific details: Alpha
-
- SEE ALSO
-
|
|