Blame man2/syscalls.2

Packit 7cfc04
.\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
Packit 7cfc04
.\" with some input from Stepan Kasal <kasal@ucw.cz>
Packit 7cfc04
.\"
Packit 7cfc04
.\" Some content retained from an earlier version of this page:
Packit 7cfc04
.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl)
Packit 7cfc04
.\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern
Packit 7cfc04
.\" <redferni@logica.com>
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(VERBATIM)
Packit 7cfc04
.\" Permission is granted to make and distribute verbatim copies of this
Packit 7cfc04
.\" manual provided the copyright notice and this permission notice are
Packit 7cfc04
.\" preserved on all copies.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Permission is granted to copy and distribute modified versions of this
Packit 7cfc04
.\" manual under the conditions for verbatim copying, provided that the
Packit 7cfc04
.\" entire resulting derived work is distributed under the terms of a
Packit 7cfc04
.\" permission notice identical to this one.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Since the Linux kernel and libraries are constantly changing, this
Packit 7cfc04
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
Packit 7cfc04
.\" responsibility for errors or omissions, or for damages resulting from
Packit 7cfc04
.\" the use of the information contained herein.  The author(s) may not
Packit 7cfc04
.\" have taken the same level of care in the production of this manual,
Packit 7cfc04
.\" which is licensed free of charge, as they might when working
Packit 7cfc04
.\" professionally.
Packit 7cfc04
.\"
Packit 7cfc04
.\" Formatted or processed versions of this manual, if unaccompanied by
Packit 7cfc04
.\" the source, must acknowledge the copyright and authors of this work.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.TH SYSCALLS 2 2018-02-02 "Linux" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
syscalls \- Linux system calls
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
Linux system calls.
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
The system call is the fundamental interface between an application
Packit 7cfc04
and the Linux kernel.
Packit 7cfc04
.SS System calls and library wrapper functions
Packit 7cfc04
System calls are generally not invoked directly,
Packit 7cfc04
but rather via wrapper functions in glibc (or perhaps some other library).
Packit 7cfc04
For details of direct invocation of a system call, see
Packit 7cfc04
.BR intro (2).
Packit 7cfc04
Often, but not always, the name of the wrapper function is the same
Packit 7cfc04
as the name of the system call that it invokes.
Packit 7cfc04
For example, glibc contains a function
Packit 7cfc04
.BR truncate ()
Packit 7cfc04
which invokes the underlying "truncate" system call.
Packit 7cfc04
.PP
Packit 7cfc04
Often the glibc wrapper function is quite thin, doing little work
Packit 7cfc04
other than copying arguments to the right registers
Packit 7cfc04
before invoking the system call,
Packit 7cfc04
and then setting
Packit 7cfc04
.I errno
Packit 7cfc04
appropriately after the system call has returned.
Packit 7cfc04
(These are the same steps that are performed by
Packit 7cfc04
.BR syscall (2),
Packit 7cfc04
which can be used to invoke system calls
Packit 7cfc04
for which no wrapper function is provided.)
Packit 7cfc04
Note: system calls indicate a failure by returning a negative error
Packit 7cfc04
number to the caller;
Packit 7cfc04
when this happens,
Packit 7cfc04
the wrapper function negates the returned error number
Packit 7cfc04
(to make it positive), copies it to
Packit 7cfc04
.IR errno ,
Packit 7cfc04
and returns \-1 to the caller of the wrapper.
Packit 7cfc04
.PP
Packit 7cfc04
Sometimes, however, the wrapper function does some extra work
Packit 7cfc04
before invoking the system call.
Packit 7cfc04
For example, nowadays there are (for reasons described below) two
Packit 7cfc04
related system calls,
Packit 7cfc04
.BR truncate (2)
Packit 7cfc04
and
Packit 7cfc04
.BR truncate64 (2),
Packit 7cfc04
and the glibc
Packit 7cfc04
.BR truncate ()
Packit 7cfc04
wrapper function checks which of those system calls
Packit 7cfc04
are provided by the kernel and determines which should be employed.
Packit 7cfc04
.SS System call list
Packit 7cfc04
Below is a list of the Linux system calls.
Packit 7cfc04
In the list, the
Packit 7cfc04
.I Kernel
Packit 7cfc04
column indicates the kernel version
Packit 7cfc04
for those system calls that were new in Linux 2.2,
Packit 7cfc04
or have appeared since that kernel version.
Packit 7cfc04
Note the following points:
Packit 7cfc04
.IP * 3
Packit 7cfc04
Where no kernel version is indicated,
Packit 7cfc04
the system call appeared in kernel 1.0 or earlier.
Packit 7cfc04
.IP *
Packit 7cfc04
Where a system call is marked "1.2"
Packit 7cfc04
this means the system call probably appeared in a 1.1.x kernel version,
Packit 7cfc04
and first appeared in a stable kernel with 1.2.
Packit 7cfc04
(Development of the 1.2 kernel was initiated from a branch of kernel
Packit 7cfc04
1.0.6 via the 1.1.x unstable kernel series.)
Packit 7cfc04
.IP *
Packit 7cfc04
Where a system call is marked "2.0"
Packit 7cfc04
this means the system call probably appeared in a 1.3.x kernel version,
Packit 7cfc04
and first appeared in a stable kernel with 2.0.
Packit 7cfc04
(Development of the 2.0 kernel was initiated from a branch of kernel
Packit 7cfc04
1.2.x, somewhere around 1.2.10,
Packit 7cfc04
via the 1.3.x unstable kernel series.)
Packit 7cfc04
.\" Was kernel 2.0 started from a branch of 1.2.10?
Packit 7cfc04
.\" At least from the timestamps of the tarballs of
Packit 7cfc04
.\" of 1.2.10 and 1.3.0, that's how it looks, but in
Packit 7cfc04
.\" fact the diff doesn't seem very clear, the
Packit 7cfc04
.\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the
Packit 7cfc04
.\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the
Packit 7cfc04
.\" timestamps of some files in 1.3.0 seem to be older
Packit 7cfc04
.\" than those in 1.2.10.  All of this suggests
Packit 7cfc04
.\" that there might not have been a clean branch point.
Packit 7cfc04
.IP *
Packit 7cfc04
Where a system call is marked "2.2"
Packit 7cfc04
this means the system call probably appeared in a 2.1.x kernel version,
Packit 7cfc04
and first appeared in a stable kernel with 2.2.0.
Packit 7cfc04
(Development of the 2.2 kernel was initiated from a branch of kernel
Packit 7cfc04
2.0.21 via the 2.1.x unstable kernel series.)
Packit 7cfc04
.IP *
Packit 7cfc04
Where a system call is marked "2.4"
Packit 7cfc04
this means the system call probably appeared in a 2.3.x kernel version,
Packit 7cfc04
and first appeared in a stable kernel with 2.4.0.
Packit 7cfc04
(Development of the 2.4 kernel was initiated from a branch of
Packit 7cfc04
kernel 2.2.8 via the 2.3.x unstable kernel series.)
Packit 7cfc04
.IP *
Packit 7cfc04
Where a system call is marked "2.6"
Packit 7cfc04
this means the system call probably appeared in a 2.5.x kernel version,
Packit 7cfc04
and first appeared in a stable kernel with 2.6.0.
Packit 7cfc04
(Development of kernel 2.6 was initiated from a branch
Packit 7cfc04
of kernel 2.4.15 via the 2.5.x unstable kernel series.)
Packit 7cfc04
.IP *
Packit 7cfc04
Starting with kernel 2.6.0, the development model changed,
Packit 7cfc04
and new system calls may appear in each 2.6.x release.
Packit 7cfc04
In this case, the exact version number where the system call appeared
Packit 7cfc04
is shown.
Packit 7cfc04
This convention continues with the 3.x kernel series,
Packit 7cfc04
which followed on from kernel 2.6.39, and the 4.x kernel series,
Packit 7cfc04
which followed on from kernel 3.19.
Packit 7cfc04
.IP *
Packit 7cfc04
In some cases, a system call was added to a stable kernel
Packit 7cfc04
series after it branched from the previous stable kernel
Packit 7cfc04
series, and then backported into the earlier stable kernel series.
Packit 7cfc04
For example some system calls that appeared in 2.6.x were also backported
Packit 7cfc04
into a 2.4.x release after 2.4.15.
Packit 7cfc04
When this is so, the version where the system call appeared
Packit 7cfc04
in both of the major kernel series is listed.
Packit 7cfc04
.PP
Packit 7cfc04
The list of system calls that are available as at kernel 4.11
Packit 7cfc04
(or in a few cases only on older kernels) is as follows:
Packit 7cfc04
.\"
Packit 7cfc04
.\" Looking at scripts/checksyscalls.sh in the kernel source is
Packit 7cfc04
.\" instructive about x86 specifics.
Packit 7cfc04
.\"
Packit 7cfc04
.ad l
Packit 7cfc04
.TS
Packit 7cfc04
l2 le l
Packit 7cfc04
---
Packit 7cfc04
l l l.
Packit 7cfc04
\fBSystem call\fP	\fBKernel\fP	\fBNotes\fP
Packit 7cfc04
Packit 7cfc04
\fB_llseek\fP(2)	1.2
Packit 7cfc04
\fB_newselect\fP(2)	2.0
Packit 7cfc04
\fB_sysctl\fP(2)	2.0
Packit 7cfc04
\fBaccept\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBaccept4\fP(2)	2.6.28
Packit 7cfc04
\fBaccess\fP(2)	1.0
Packit 7cfc04
\fBacct\fP(2)	1.0
Packit 7cfc04
\fBadd_key\fP(2)	2.6.10
Packit 7cfc04
\fBadjtimex\fP(2)	1.0
Packit 7cfc04
\fBalarm\fP(2)	1.0
Packit 7cfc04
\fBalloc_hugepages\fP(2)	2.5.36	Removed in 2.5.44
Packit 7cfc04
\fBbdflush\fP(2)	1.2	T{
Packit 7cfc04
Deprecated (does nothing)
Packit 7cfc04
.br
Packit 7cfc04
since 2.6
Packit 7cfc04
T}
Packit 7cfc04
\fBbind\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBbpf\fP(2)	3.18
Packit 7cfc04
\fBbrk\fP(2)	1.0
Packit 7cfc04
\fBcacheflush\fP(2)	1.2	Not on x86
Packit 7cfc04
\fBcapget\fP(2)	2.2
Packit 7cfc04
\fBcapset\fP(2)	2.2
Packit 7cfc04
\fBchdir\fP(2)	1.0
Packit 7cfc04
\fBchmod\fP(2)	1.0
Packit 7cfc04
\fBchown\fP(2)	2.2	T{
Packit 7cfc04
See \fBchown\fP(2) for
Packit 7cfc04
.br
Packit 7cfc04
version details
Packit 7cfc04
T}
Packit 7cfc04
\fBchown32\fP(2)	2.4
Packit 7cfc04
\fBchroot\fP(2)	1.0
Packit 7cfc04
\fBclock_adjtime\fP(2)	2.6.39
Packit 7cfc04
\fBclock_getres\fP(2)	2.6
Packit 7cfc04
\fBclock_gettime\fP(2)	2.6
Packit 7cfc04
\fBclock_nanosleep\fP(2)	2.6
Packit 7cfc04
\fBclock_settime\fP(2)	2.6
Packit 7cfc04
\fBclone\fP(2)	1.0
Packit 7cfc04
\fBclose\fP(2)	1.0
Packit 7cfc04
\fBconnect\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBcopy_file_range\fP(2)	4.5
Packit 7cfc04
\fBcreat\fP(2)	1.0
Packit 7cfc04
\fBcreate_module\fP(2)	1.0	Removed in 2.6
Packit 7cfc04
\fBdelete_module\fP(2)	1.0
Packit 7cfc04
\fBdup\fP(2)	1.0
Packit 7cfc04
\fBdup2\fP(2)	1.0
Packit 7cfc04
\fBdup3\fP(2)	2.6.27
Packit 7cfc04
\fBepoll_create\fP(2)	2.6
Packit 7cfc04
\fBepoll_create1\fP(2)	2.6.27
Packit 7cfc04
\fBepoll_ctl\fP(2)	2.6
Packit 7cfc04
\fBepoll_pwait\fP(2)	2.6.19
Packit 7cfc04
\fBepoll_wait\fP(2)	2.6
Packit 7cfc04
\fBeventfd\fP(2)	2.6.22
Packit 7cfc04
\fBeventfd2\fP(2)	2.6.27
Packit 7cfc04
\fBexecve\fP(2)	1.0
Packit 7cfc04
\fBexecveat\fP(2)	3.19
Packit 7cfc04
\fBexit\fP(2)	1.0
Packit 7cfc04
\fBexit_group\fP(2)	2.6
Packit 7cfc04
\fBfaccessat\fP(2)	2.6.16
Packit 7cfc04
\fBfadvise64\fP(2)	2.6
Packit 7cfc04
.\" Implements \fBposix_fadvise\fP(2)
Packit 7cfc04
\fBfadvise64_64\fP(2)	2.6
Packit 7cfc04
\fBfallocate\fP(2)	2.6.23
Packit 7cfc04
\fBfanotify_init\fP(2)	2.6.37
Packit 7cfc04
\fBfanotify_mark\fP(2)	2.6.37
Packit 7cfc04
.\" The fanotify calls were added in Linux 2.6.36,
Packit 7cfc04
.\" but disabled while the API was finalized.
Packit 7cfc04
\fBfchdir\fP(2)	1.0
Packit 7cfc04
\fBfchmod\fP(2)	1.0
Packit 7cfc04
\fBfchmodat\fP(2)	2.6.16
Packit 7cfc04
\fBfchown\fP(2)	1.0
Packit 7cfc04
\fBfchown32\fP(2)	2.4
Packit 7cfc04
\fBfchownat\fP(2)	2.6.16
Packit 7cfc04
\fBfcntl\fP(2)	1.0
Packit 7cfc04
\fBfcntl64\fP(2)	2.4
Packit 7cfc04
\fBfdatasync\fP(2)	2.0
Packit 7cfc04
\fBfgetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBfinit_module\fP(2)	3.8
Packit 7cfc04
\fBflistxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBflock\fP(2)	2.0
Packit 7cfc04
\fBfork\fP(2)	1.0
Packit 7cfc04
\fBfree_hugepages\fP(2)	2.5.36	Removed in 2.5.44
Packit 7cfc04
\fBfremovexattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBfsetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBfstat\fP(2)	1.0
Packit 7cfc04
\fBfstat64\fP(2)	2.4
Packit 7cfc04
\fBfstatat64\fP(2)	2.6.16
Packit 7cfc04
\fBfstatfs\fP(2)	1.0
Packit 7cfc04
\fBfstatfs64\fP(2)	2.6
Packit 7cfc04
\fBfsync\fP(2)	1.0
Packit 7cfc04
\fBftruncate\fP(2)	1.0
Packit 7cfc04
\fBftruncate64\fP(2)	2.4
Packit 7cfc04
\fBfutex\fP(2)	2.6
Packit 7cfc04
\fBfutimesat\fP(2)	2.6.16
Packit 7cfc04
\fBget_kernel_syms\fP(2)	1.0	Removed in 2.6
Packit 7cfc04
\fBget_mempolicy\fP(2)	2.6.6
Packit 7cfc04
\fBget_robust_list\fP(2)	2.6.17
Packit 7cfc04
\fBget_thread_area\fP(2)	2.6
Packit 7cfc04
\fBgetcpu\fP(2)	2.6.19
Packit 7cfc04
\fBgetcwd\fP(2)	2.2
Packit 7cfc04
\fBgetdents\fP(2)	2.0
Packit 7cfc04
\fBgetdents64\fP(2)	2.4
Packit 7cfc04
\fBgetegid\fP(2)	1.0
Packit 7cfc04
\fBgetegid32\fP(2)	2.4
Packit 7cfc04
\fBgeteuid\fP(2)	1.0
Packit 7cfc04
\fBgeteuid32\fP(2)	2.4
Packit 7cfc04
\fBgetgid\fP(2)	1.0
Packit 7cfc04
\fBgetgid32\fP(2)	2.4
Packit 7cfc04
\fBgetgroups\fP(2)	1.0
Packit 7cfc04
\fBgetgroups32\fP(2)	2.4
Packit 7cfc04
\fBgetitimer\fP(2)	1.0
Packit 7cfc04
\fBgetpeername\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBgetpagesize\fP(2)	2.0	Not on x86
Packit 7cfc04
\fBgetpgid\fP(2)	1.0
Packit 7cfc04
\fBgetpgrp\fP(2)	1.0
Packit 7cfc04
\fBgetpid\fP(2)	1.0
Packit 7cfc04
\fBgetppid\fP(2)	1.0
Packit 7cfc04
\fBgetpriority\fP(2)	1.0
Packit 7cfc04
\fBgetrandom\fP(2)	3.17
Packit 7cfc04
\fBgetresgid\fP(2)	2.2
Packit 7cfc04
\fBgetresgid32\fP(2)	2.4
Packit 7cfc04
\fBgetresuid\fP(2)	2.2
Packit 7cfc04
\fBgetresuid32\fP(2)	2.4
Packit 7cfc04
\fBgetrlimit\fP(2)	1.0
Packit 7cfc04
\fBgetrusage\fP(2)	1.0
Packit 7cfc04
\fBgetsid\fP(2)	2.0
Packit 7cfc04
\fBgetsockname\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBgetsockopt\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBgettid\fP(2)	2.4.11
Packit 7cfc04
\fBgettimeofday\fP(2)	1.0
Packit 7cfc04
\fBgetuid\fP(2)	1.0
Packit 7cfc04
\fBgetuid32\fP(2)	2.4
Packit 7cfc04
\fBgetunwind\fP(2)	2.4.8	ia64; deprecated
Packit 7cfc04
\fBgetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBinit_module\fP(2)	1.0
Packit 7cfc04
\fBinotify_add_watch\fP(2)	2.6.13
Packit 7cfc04
\fBinotify_init\fP(2)	2.6.13
Packit 7cfc04
\fBinotify_init1\fP(2)	2.6.27
Packit 7cfc04
\fBinotify_rm_watch\fP(2)	2.6.13
Packit 7cfc04
\fBio_cancel\fP(2)	2.6
Packit 7cfc04
\fBio_destroy\fP(2)	2.6
Packit 7cfc04
\fBio_getevents\fP(2)	2.6
Packit 7cfc04
\fBio_setup\fP(2)	2.6
Packit 7cfc04
\fBio_submit\fP(2)	2.6
Packit 7cfc04
\fBioctl\fP(2)	1.0
Packit 7cfc04
\fBioperm\fP(2)	1.0
Packit 7cfc04
\fBiopl\fP(2)	1.0
Packit 7cfc04
\fBioprio_get\fP(2)	2.6.13
Packit 7cfc04
\fBioprio_set\fP(2)	2.6.13
Packit 7cfc04
\fBipc\fP(2)	1.0
Packit 7cfc04
.\" Implements System V IPC calls
Packit 7cfc04
\fBkcmp\fP(2)	3.5
Packit 7cfc04
\fBkern_features\fP(2)	3.7	Sparc64
Packit 7cfc04
.\" FIXME . document kern_features():
Packit 7cfc04
.\" commit 517ffce4e1a03aea979fe3a18a3dd1761a24fafb
Packit 7cfc04
\fBkexec_file_load\fP(2)	3.17
Packit 7cfc04
\fBkexec_load\fP(2)	2.6.13
Packit 7cfc04
.\" The entry in the syscall table was reserved starting in 2.6.7
Packit 7cfc04
.\" Was named sys_kexec_load() from 2.6.7 to 2.6.16
Packit 7cfc04
\fBkeyctl\fP(2)	2.6.10
Packit 7cfc04
\fBkill\fP(2)	1.0
Packit 7cfc04
\fBlchown\fP(2)	1.0	T{
Packit 7cfc04
See \fBchown\fP(2) for
Packit 7cfc04
.br
Packit 7cfc04
version details
Packit 7cfc04
T}
Packit 7cfc04
\fBlchown32\fP(2)	2.4
Packit 7cfc04
\fBlgetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBlink\fP(2)	1.0
Packit 7cfc04
\fBlinkat\fP(2)	2.6.16
Packit 7cfc04
\fBlisten\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBlistxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBllistxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBlookup_dcookie\fP(2)	2.6
Packit 7cfc04
\fBlremovexattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBlseek\fP(2)	1.0
Packit 7cfc04
\fBlsetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBlstat\fP(2)	1.0
Packit 7cfc04
\fBlstat64\fP(2)	2.4
Packit 7cfc04
\fBmadvise\fP(2)	2.4
Packit 7cfc04
\fBmbind\fP(2)	2.6.6
Packit 7cfc04
.\" \fBmemory_ordering\fP(2)	???	Sparc64
Packit 7cfc04
\fBmembarrier\fP(2)	3.17
Packit 7cfc04
\fBmemfd_create\fP(2)	3.17
Packit 7cfc04
\fBmigrate_pages\fP(2)	2.6.16
Packit 7cfc04
\fBmincore\fP(2)	2.4
Packit 7cfc04
\fBmkdir\fP(2)	1.0
Packit 7cfc04
\fBmkdirat\fP(2)	2.6.16
Packit 7cfc04
\fBmknod\fP(2)	1.0
Packit 7cfc04
\fBmknodat\fP(2)	2.6.16
Packit 7cfc04
\fBmlock\fP(2)	2.0
Packit 7cfc04
\fBmlock2\fP(2)	4.4
Packit 7cfc04
\fBmlockall\fP(2)	2.0
Packit 7cfc04
\fBmmap\fP(2)	1.0
Packit 7cfc04
\fBmmap2\fP(2)	2.4
Packit 7cfc04
\fBmodify_ldt\fP(2)	1.0
Packit 7cfc04
\fBmount\fP(2)	1.0
Packit 7cfc04
\fBmove_pages\fP(2)	2.6.18
Packit 7cfc04
\fBmprotect\fP(2)	1.0
Packit 7cfc04
\fBmq_getsetattr\fP(2)	2.6.6
Packit 7cfc04
.\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
Packit 7cfc04
\fBmq_notify\fP(2)	2.6.6
Packit 7cfc04
\fBmq_open\fP(2)	2.6.6
Packit 7cfc04
\fBmq_timedreceive\fP(2)	2.6.6
Packit 7cfc04
\fBmq_timedsend\fP(2)	2.6.6
Packit 7cfc04
\fBmq_unlink\fP(2)	2.6.6
Packit 7cfc04
\fBmremap\fP(2)	2.0
Packit 7cfc04
\fBmsgctl\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBmsgget\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBmsgrcv\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBmsgsnd\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBmsync\fP(2)	2.0
Packit 7cfc04
.\" \fBmultiplexer\fP(2)	??	__NR_multiplexer reserved on
Packit 7cfc04
.\"		PowerPC, but unimplemented?
Packit 7cfc04
\fBmunlock\fP(2)	2.0
Packit 7cfc04
\fBmunlockall\fP(2)	2.0
Packit 7cfc04
\fBmunmap\fP(2)	1.0
Packit 7cfc04
\fBname_to_handle_at\fP(2)	2.6.39
Packit 7cfc04
\fBnanosleep\fP(2)	2.0
Packit 7cfc04
\fBnfsservctl\fP(2)	2.2	Removed in 3.1
Packit 7cfc04
\fBnice\fP(2)	1.0
Packit 7cfc04
\fBoldfstat\fP(2)	1.0
Packit 7cfc04
\fBoldlstat\fP(2)	1.0
Packit 7cfc04
\fBoldolduname\fP(2)	1.0
Packit 7cfc04
\fBoldstat\fP(2)	1.0
Packit 7cfc04
\fBolduname\fP(2)	1.0
Packit 7cfc04
\fBopen\fP(2)	1.0
Packit 7cfc04
\fBopen_by_handle_at\fP(2)	2.6.39
Packit 7cfc04
\fBopenat\fP(2)	2.6.16
Packit 7cfc04
\fBpause\fP(2)	1.0
Packit 7cfc04
\fBpciconfig_iobase\fP(2)	2.2.15; 2.4	Not on x86
Packit 7cfc04
.\" Alpha, PowerPC, ARM; not x86
Packit 7cfc04
\fBpciconfig_read\fP(2)	2.0.26; 2.2	Not on x86
Packit 7cfc04
.\" , PowerPC, ARM; not x86
Packit 7cfc04
\fBpciconfig_write\fP(2)	2.0.26; 2.2	Not on x86
Packit 7cfc04
.\" , PowerPC, ARM; not x86
Packit 7cfc04
\fBperf_event_open\fP(2)	2.6.31	T{
Packit 7cfc04
Was perf_counter_open() in
Packit 7cfc04
.br
Packit 7cfc04
2.6.31; renamed in 2.6.32
Packit 7cfc04
T}
Packit 7cfc04
\fBpersonality\fP(2)	1.2
Packit 7cfc04
\fBperfctr\fP(2)	2.2	Sparc; removed in 2.6.34
Packit 7cfc04
.\"	commit c7d5a0050773e98d1094eaa9f2a1a793fafac300 removed perfctr()
Packit 7cfc04
\fBperfmonctl\fP(2)	2.4	ia64
Packit 7cfc04
\fBpipe\fP(2)	1.0
Packit 7cfc04
\fBpipe2\fP(2)	2.6.27
Packit 7cfc04
\fBpivot_root\fP(2)	2.4
Packit 7cfc04
\fBpkey_alloc\fP(2)	4.8
Packit 7cfc04
\fBpkey_free\fP(2)	4.8
Packit 7cfc04
\fBpkey_mprotect\fP(2)	4.8
Packit 7cfc04
\fBpoll\fP(2)	2.0.36; 2.2
Packit 7cfc04
\fBppc_rtas\fP(2)	2.6.2	PowerPC only
Packit 7cfc04
\fBppc_swapcontext\fP(2)	2.6.3	PowerPC only
Packit 7cfc04
\fBppoll\fP(2)	2.6.16
Packit 7cfc04
\fBprctl\fP(2)	2.2
Packit 7cfc04
\fBpread64\fP(2)		T{
Packit 7cfc04
Added as "pread" in 2.2;
Packit 7cfc04
.br
Packit 7cfc04
renamed "pread64" in 2.6
Packit 7cfc04
T}
Packit 7cfc04
\fBpreadv\fP(2)	2.6.30
Packit 7cfc04
\fBpreadv2\fP(2)	4.6
Packit 7cfc04
\fBprlimit64\fP(2)	2.6.36
Packit 7cfc04
\fBprocess_vm_readv\fP(2)	3.2
Packit 7cfc04
\fBprocess_vm_writev\fP(2)	3.2
Packit 7cfc04
\fBpselect6\fP(2)	2.6.16
Packit 7cfc04
.\" Implements \fBpselect\fP(2)
Packit 7cfc04
\fBptrace\fP(2)	1.0
Packit 7cfc04
\fBpwrite64\fP(2)		T{
Packit 7cfc04
Added as "pwrite" in 2.2;
Packit 7cfc04
.br
Packit 7cfc04
renamed "pwrite64" in 2.6
Packit 7cfc04
T}
Packit 7cfc04
\fBpwritev\fP(2)	2.6.30
Packit 7cfc04
\fBpwritev2\fP(2)	4.6
Packit 7cfc04
\fBquery_module\fP(2)	2.2	Removed in 2.6
Packit 7cfc04
\fBquotactl\fP(2)	1.0
Packit 7cfc04
\fBread\fP(2)	1.0
Packit 7cfc04
\fBreadahead\fP(2)	2.4.13
Packit 7cfc04
\fBreaddir\fP(2)	1.0
Packit 7cfc04
.\" Supersedes \fBgetdents\fP(2)
Packit 7cfc04
\fBreadlink\fP(2)	1.0
Packit 7cfc04
\fBreadlinkat\fP(2)	2.6.16
Packit 7cfc04
\fBreadv\fP(2)	2.0
Packit 7cfc04
\fBreboot\fP(2)	1.0
Packit 7cfc04
\fBrecv\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBrecvfrom\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBrecvmsg\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBrecvmmsg\fP(2)	2.6.33
Packit 7cfc04
\fBremap_file_pages\fP(2)	2.6	Deprecated since 3.16
Packit 7cfc04
\fBremovexattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBrename\fP(2)	1.0
Packit 7cfc04
\fBrenameat\fP(2)	2.6.16
Packit 7cfc04
\fBrenameat2\fP(2)	3.15
Packit 7cfc04
\fBrequest_key\fP(2)	2.6.10
Packit 7cfc04
\fBrestart_syscall\fP(2)	2.6
Packit 7cfc04
\fBrmdir\fP(2)	1.0
Packit 7cfc04
\fBrt_sigaction\fP(2)	2.2
Packit 7cfc04
\fBrt_sigpending\fP(2)	2.2
Packit 7cfc04
\fBrt_sigprocmask\fP(2)	2.2
Packit 7cfc04
\fBrt_sigqueueinfo\fP(2)	2.2
Packit 7cfc04
\fBrt_sigreturn\fP(2)	2.2
Packit 7cfc04
\fBrt_sigsuspend\fP(2)	2.2
Packit 7cfc04
\fBrt_sigtimedwait\fP(2)	2.2
Packit 7cfc04
\fBrt_tgsigqueueinfo\fP(2)	2.6.31
Packit 7cfc04
\fBs390_runtime_instr\fP(2)	3.7	s390 only
Packit 7cfc04
\fBs390_pci_mmio_read\fP(2)	3.19	s390 only
Packit 7cfc04
\fBs390_pci_mmio_write\fP(2)	3.19	s390 only
Packit 7cfc04
\fBs390_sthyi\fP(2)	4.15	s390 only
Packit 7cfc04
\fBsched_get_priority_max\fP(2)	2.0
Packit 7cfc04
\fBsched_get_priority_min\fP(2)	2.0
Packit 7cfc04
\fBsched_getaffinity\fP(2)	2.6
Packit 7cfc04
\fBsched_getattr\fP(2)	3.14
Packit 7cfc04
\fBsched_getparam\fP(2)	2.0
Packit 7cfc04
\fBsched_getscheduler\fP(2)	2.0
Packit 7cfc04
\fBsched_rr_get_interval\fP(2)	2.0
Packit 7cfc04
\fBsched_setaffinity\fP(2)	2.6
Packit 7cfc04
\fBsched_setattr\fP(2)	3.14
Packit 7cfc04
\fBsched_setparam\fP(2)	2.0
Packit 7cfc04
\fBsched_setscheduler\fP(2)	2.0
Packit 7cfc04
\fBsched_yield\fP(2)	2.0
Packit 7cfc04
\fBseccomp\fP(2)	3.17
Packit 7cfc04
\fBselect\fP(2)	1.0
Packit 7cfc04
\fBsemctl\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBsemget\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBsemop\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBsemtimedop\fP(2)	2.6; 2.4.22
Packit 7cfc04
\fBsend\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsendfile\fP(2)	2.2
Packit 7cfc04
\fBsendfile64\fP(2)	2.6; 2.4.19
Packit 7cfc04
\fBsendmmsg\fP(2)	3.0
Packit 7cfc04
\fBsendmsg\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsendto\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBset_mempolicy\fP(2)	2.6.6
Packit 7cfc04
\fBset_robust_list\fP(2)	2.6.17
Packit 7cfc04
\fBset_thread_area\fP(2)	2.6
Packit 7cfc04
\fBset_tid_address\fP(2)	2.6
Packit 7cfc04
.\" See http://lkml.org/lkml/2005/8/1/83
Packit 7cfc04
.\" "[PATCH] remove sys_set_zone_reclaim()"
Packit 7cfc04
\fBsetdomainname\fP(2)	1.0
Packit 7cfc04
\fBsetfsgid\fP(2)	1.2
Packit 7cfc04
\fBsetfsgid32\fP(2)	2.4
Packit 7cfc04
\fBsetfsuid\fP(2)	1.2
Packit 7cfc04
\fBsetfsuid32\fP(2)	2.4
Packit 7cfc04
\fBsetgid\fP(2)	1.0
Packit 7cfc04
\fBsetgid32\fP(2)	2.4
Packit 7cfc04
\fBsetgroups\fP(2)	1.0
Packit 7cfc04
\fBsetgroups32\fP(2)	2.4
Packit 7cfc04
\fBsethostname\fP(2)	1.0
Packit 7cfc04
\fBsetitimer\fP(2)	1.0
Packit 7cfc04
\fBsetns\fP(2)	3.0
Packit 7cfc04
\fBsetpgid\fP(2)	1.0
Packit 7cfc04
\fBsetpriority\fP(2)	1.0
Packit 7cfc04
\fBsetregid\fP(2)	1.0
Packit 7cfc04
\fBsetregid32\fP(2)	2.4
Packit 7cfc04
\fBsetresgid\fP(2)	2.2
Packit 7cfc04
\fBsetresgid32\fP(2)	2.4
Packit 7cfc04
\fBsetresuid\fP(2)	2.2
Packit 7cfc04
\fBsetresuid32\fP(2)	2.4
Packit 7cfc04
\fBsetreuid\fP(2)	1.0
Packit 7cfc04
\fBsetreuid32\fP(2)	2.4
Packit 7cfc04
\fBsetrlimit\fP(2)	1.0
Packit 7cfc04
\fBsetsid\fP(2)	1.0
Packit 7cfc04
\fBsetsockopt\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsettimeofday\fP(2)	1.0
Packit 7cfc04
\fBsetuid\fP(2)	1.0
Packit 7cfc04
\fBsetuid32\fP(2)	2.4
Packit 7cfc04
\fBsetup\fP(2)	1.0	Removed in 2.2
Packit 7cfc04
\fBsetxattr\fP(2)	2.6; 2.4.18
Packit 7cfc04
\fBsgetmask\fP(2)	1.0
Packit 7cfc04
\fBshmat\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBshmctl\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBshmdt\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBshmget\fP(2)	2.0	See notes on \fBipc\fP(2)
Packit 7cfc04
\fBshutdown\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsigaction\fP(2)	1.0
Packit 7cfc04
\fBsigaltstack\fP(2)	2.2
Packit 7cfc04
\fBsignal\fP(2)	1.0
Packit 7cfc04
\fBsignalfd\fP(2)	2.6.22
Packit 7cfc04
\fBsignalfd4\fP(2)	2.6.27
Packit 7cfc04
\fBsigpending\fP(2)	1.0
Packit 7cfc04
\fBsigprocmask\fP(2)	1.0
Packit 7cfc04
\fBsigreturn\fP(2)	1.0
Packit 7cfc04
\fBsigsuspend\fP(2)	1.0
Packit 7cfc04
\fBsocket\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsocketcall\fP(2)	1.0
Packit 7cfc04
.\" Implements BSD socket calls
Packit 7cfc04
\fBsocketpair\fP(2)	2.0	See notes on \fBsocketcall\fP(2)
Packit 7cfc04
\fBsplice\fP(2)	2.6.17
Packit 7cfc04
\fBspu_create\fP(2)	2.6.16	PowerPC only
Packit 7cfc04
\fBspu_run\fP(2)	2.6.16	PowerPC only
Packit 7cfc04
\fBssetmask\fP(2)	1.0
Packit 7cfc04
\fBstat\fP(2)	1.0
Packit 7cfc04
\fBstat64\fP(2)	2.4
Packit 7cfc04
\fBstatfs\fP(2)	1.0
Packit 7cfc04
\fBstatfs64\fP(2)	2.6
Packit 7cfc04
\fBstatx\fP(2)	4.11
Packit 7cfc04
\fBstime\fP(2)	1.0
Packit 7cfc04
\fBsubpage_prot\fP(2)	2.6.25	PowerPC only
Packit 7cfc04
\fBswapoff\fP(2)	1.0
Packit 7cfc04
\fBswapon\fP(2)	1.0
Packit 7cfc04
\fBsymlink\fP(2)	1.0
Packit 7cfc04
\fBsymlinkat\fP(2)	2.6.16
Packit 7cfc04
\fBsync\fP(2)	1.0
Packit 7cfc04
\fBsync_file_range\fP(2)	2.6.17
Packit 7cfc04
\fBsync_file_range2\fP(2)	2.6.22
Packit 7cfc04
.\" PowerPC, ARM, tile
Packit 7cfc04
.\" First appeared on ARM, as arm_sync_file_range(), but later renamed
Packit 7cfc04
.\" \fBsys_debug_setcontext\fP(2)	???	PowerPC if CONFIG_PPC32
Packit 7cfc04
\fBsyncfs\fP(2)	2.6.39
Packit 7cfc04
\fBsysfs\fP(2)	1.2
Packit 7cfc04
\fBsysinfo\fP(2)	1.0
Packit 7cfc04
\fBsyslog\fP(2)	1.0
Packit 7cfc04
.\" glibc interface is \fBklogctl\fP(3)
Packit 7cfc04
\fBtee\fP(2)	2.6.17
Packit 7cfc04
\fBtgkill\fP(2)	2.6
Packit 7cfc04
\fBtime\fP(2)	1.0
Packit 7cfc04
\fBtimer_create\fP(2)	2.6
Packit 7cfc04
\fBtimer_delete\fP(2)	2.6
Packit 7cfc04
\fBtimer_getoverrun\fP(2)	2.6
Packit 7cfc04
\fBtimer_gettime\fP(2)	2.6
Packit 7cfc04
\fBtimer_settime\fP(2)	2.6
Packit 7cfc04
\fBtimerfd_create\fP(2)	2.6.25
Packit 7cfc04
\fBtimerfd_gettime\fP(2)	2.6.25
Packit 7cfc04
\fBtimerfd_settime\fP(2)	2.6.25
Packit 7cfc04
\fBtimes\fP(2)	1.0
Packit 7cfc04
\fBtkill\fP(2)	2.6; 2.4.22
Packit 7cfc04
\fBtruncate\fP(2)	1.0
Packit 7cfc04
\fBtruncate64\fP(2)	2.4
Packit 7cfc04
\fBugetrlimit\fP(2)	2.4
Packit 7cfc04
\fBumask\fP(2)	1.0
Packit 7cfc04
\fBumount\fP(2)	1.0
Packit 7cfc04
.\" sys_oldumount() -- __NR_umount
Packit 7cfc04
\fBumount2\fP(2)	2.2
Packit 7cfc04
.\" sys_umount() -- __NR_umount2
Packit 7cfc04
\fBuname\fP(2)	1.0
Packit 7cfc04
\fBunlink\fP(2)	1.0
Packit 7cfc04
\fBunlinkat\fP(2)	2.6.16
Packit 7cfc04
\fBunshare\fP(2)	2.6.16
Packit 7cfc04
\fBuselib\fP(2)	1.0
Packit 7cfc04
\fBustat\fP(2)	1.0
Packit 7cfc04
\fBuserfaultfd\fP(2)	4.3
Packit 7cfc04
\fButime\fP(2)	1.0
Packit 7cfc04
\fButimensat\fP(2)	2.6.22
Packit 7cfc04
\fButimes\fP(2)	2.2
Packit 7cfc04
\fButrap_install\fP(2)	2.2	Sparc only
Packit 7cfc04
.\" FIXME . document utrap_install()
Packit 7cfc04
.\" There's a man page for Solaris 5.11
Packit 7cfc04
\fBvfork\fP(2)	2.2
Packit 7cfc04
\fBvhangup\fP(2)	1.0
Packit 7cfc04
\fBvm86old\fP(2)	1.0	T{
Packit 7cfc04
Was "vm86"; renamed in
Packit 7cfc04
2.0.28/2.2
Packit 7cfc04
T}
Packit 7cfc04
\fBvm86\fP(2)	2.0.28; 2.2
Packit 7cfc04
\fBvmsplice\fP(2)	2.6.17
Packit 7cfc04
\fBwait4\fP(2)	1.0
Packit 7cfc04
\fBwaitid\fP(2)	2.6.10
Packit 7cfc04
\fBwaitpid\fP(2)	1.0
Packit 7cfc04
\fBwrite\fP(2)	1.0
Packit 7cfc04
\fBwritev\fP(2)	2.0
Packit 7cfc04
.TE
Packit 7cfc04
.ad
Packit 7cfc04
.PP
Packit 7cfc04
On many platforms, including x86-32, socket calls are all multiplexed
Packit 7cfc04
(via glibc wrapper functions) through
Packit 7cfc04
.BR socketcall (2)
Packit 7cfc04
and similarly System\ V IPC calls are multiplexed through
Packit 7cfc04
.BR ipc (2).
Packit 7cfc04
.PP
Packit 7cfc04
Although slots are reserved for them in the system call table,
Packit 7cfc04
the following system calls are not implemented in the standard kernel:
Packit 7cfc04
.BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
Packit 7cfc04
.BR break (2),       \" __NR_break is 17 on Linux 2.6.22/i386
Packit 7cfc04
.BR ftime (2),       \" __NR_ftime is 35 on Linux 2.6.22/i386
Packit 7cfc04
.BR getpmsg (2),     \" __NR_getpmsg is 188 on Linux 2.6.22/i386
Packit 7cfc04
.BR gtty (2),        \" __NR_gtty is 32 on Linux 2.6.22/i386
Packit 7cfc04
.BR idle (2),        \" __NR_idle is 112 on Linux 2.6.22/i386
Packit 7cfc04
.BR lock (2),        \" __NR_lock is 53 on Linux 2.6.22/i386
Packit 7cfc04
.BR madvise1 (2),    \" __NR_madvise1 is 219 on Linux 2.6.22/i386
Packit 7cfc04
.BR mpx (2),         \" __NR_mpx is 66 on Linux 2.6.22/i386
Packit 7cfc04
.BR phys (2),        \" Slot has been reused
Packit 7cfc04
.BR prof (2),        \" __NR_prof is 44 on Linux 2.6.22/i386
Packit 7cfc04
.BR profil (2),      \" __NR_profil is 98 on Linux 2.6.22/i386
Packit 7cfc04
.BR putpmsg (2),     \" __NR_putpmsg is 189 on Linux 2.6.22/i386
Packit 7cfc04
.\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
Packit 7cfc04
.\" on a couple of 2.6 architectures
Packit 7cfc04
.BR security (2),    \" __NR_security is 223 on Linux 2.4/i386
Packit 7cfc04
.\" The security call is for future use.
Packit 7cfc04
.BR stty (2),        \" __NR_stty is 31 on Linux 2.6.22/i386
Packit 7cfc04
.BR tuxcall (2),     \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
Packit 7cfc04
.BR ulimit (2),      \" __NR_ulimit is 58 on Linux 2.6.22/i386
Packit 7cfc04
and
Packit 7cfc04
.BR vserver (2)      \" __NR_vserver is 273 on Linux 2.6.22/i386
Packit 7cfc04
(see also
Packit 7cfc04
.BR unimplemented (2)).
Packit 7cfc04
However,
Packit 7cfc04
.BR ftime (3),
Packit 7cfc04
.BR profil (3),
Packit 7cfc04
and
Packit 7cfc04
.BR ulimit (3)
Packit 7cfc04
exist as library routines.
Packit 7cfc04
The slot for
Packit 7cfc04
.BR phys (2)
Packit 7cfc04
is in use since kernel 2.1.116 for
Packit 7cfc04
.BR umount (2);
Packit 7cfc04
.BR phys (2)
Packit 7cfc04
will never be implemented.
Packit 7cfc04
The
Packit 7cfc04
.BR getpmsg (2)
Packit 7cfc04
and
Packit 7cfc04
.BR putpmsg (2)
Packit 7cfc04
calls are for kernels patched to support STREAMS,
Packit 7cfc04
and may never be in the standard kernel.
Packit 7cfc04
.PP
Packit 7cfc04
There was briefly
Packit 7cfc04
.BR set_zone_reclaim (2),
Packit 7cfc04
added in Linux 2.6.13, and removed in 2.6.16;
Packit 7cfc04
this system call was never available to user space.
Packit 7cfc04
.SH NOTES
Packit 7cfc04
.PP
Packit 7cfc04
Roughly speaking, the code belonging to the system call
Packit 7cfc04
with number __NR_xxx defined in
Packit 7cfc04
.I /usr/include/asm/unistd.h
Packit 7cfc04
can be found in the Linux kernel source in the routine
Packit 7cfc04
.IR sys_xxx ().
Packit 7cfc04
(The dispatch table for i386 can be found in
Packit 7cfc04
.IR /usr/src/linux/arch/i386/kernel/entry.S .)
Packit 7cfc04
There are many exceptions, however, mostly because
Packit 7cfc04
older system calls were superseded by newer ones,
Packit 7cfc04
and this has been treated somewhat unsystematically.
Packit 7cfc04
On platforms with
Packit 7cfc04
proprietary operating-system emulation,
Packit 7cfc04
such as parisc, sparc, sparc64, and alpha,
Packit 7cfc04
there are many additional system calls; mips64 also contains a full
Packit 7cfc04
set of 32-bit system calls.
Packit 7cfc04
.PP
Packit 7cfc04
Over time, changes to the interfaces of some system calls have been
Packit 7cfc04
necessary.
Packit 7cfc04
One reason for such changes was the need to increase the size of
Packit 7cfc04
structures or scalar values passed to the system call.
Packit 7cfc04
Because of these changes, certain architectures
Packit 7cfc04
(notably, longstanding 32-bit architectures such as i386)
Packit 7cfc04
now have various groups of related system calls (e.g.,
Packit 7cfc04
.BR truncate (2)
Packit 7cfc04
and
Packit 7cfc04
.BR truncate64 (2))
Packit 7cfc04
which perform similar tasks, but which vary in
Packit 7cfc04
details such as the size of their arguments.
Packit 7cfc04
(As noted earlier, applications are generally unaware of this:
Packit 7cfc04
the glibc wrapper functions do some work to ensure that the right
Packit 7cfc04
system call is invoked, and that ABI compatibility is
Packit 7cfc04
preserved for old binaries.)
Packit 7cfc04
Examples of systems calls that exist in multiple versions are
Packit 7cfc04
the following:
Packit 7cfc04
.IP * 3
Packit 7cfc04
By now there are three different versions of
Packit 7cfc04
.BR stat (2):
Packit 7cfc04
.IR sys_stat ()
Packit 7cfc04
(slot
Packit 7cfc04
.IR __NR_oldstat ),
Packit 7cfc04
.IR sys_newstat ()
Packit 7cfc04
(slot
Packit 7cfc04
.IR __NR_stat ),
Packit 7cfc04
and
Packit 7cfc04
.IR sys_stat64 ()
Packit 7cfc04
(slot
Packit 7cfc04
.IR __NR_stat64 ),
Packit 7cfc04
with the last being the most current.
Packit 7cfc04
.\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
Packit 7cfc04
.\" The stat system calls deal with three different data structures,
Packit 7cfc04
.\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
Packit 7cfc04
A similar story applies for
Packit 7cfc04
.BR lstat (2)
Packit 7cfc04
and
Packit 7cfc04
.BR fstat (2).
Packit 7cfc04
.IP *
Packit 7cfc04
Similarly, the defines
Packit 7cfc04
.IR __NR_oldolduname ,
Packit 7cfc04
.IR __NR_olduname ,
Packit 7cfc04
and
Packit 7cfc04
.I __NR_uname
Packit 7cfc04
refer to the routines
Packit 7cfc04
.IR sys_olduname (),
Packit 7cfc04
.IR sys_uname ()
Packit 7cfc04
and
Packit 7cfc04
.IR sys_newuname ().
Packit 7cfc04
.IP *
Packit 7cfc04
In Linux 2.0, a new version of
Packit 7cfc04
.BR vm86 (2)
Packit 7cfc04
appeared, with the old and the new kernel routines being named
Packit 7cfc04
.IR sys_vm86old ()
Packit 7cfc04
and
Packit 7cfc04
.IR sys_vm86 ().
Packit 7cfc04
.IP *
Packit 7cfc04
In Linux 2.4, a new version of
Packit 7cfc04
.BR getrlimit (2)
Packit 7cfc04
appeared, with the old and the new kernel routines being named
Packit 7cfc04
.IR sys_old_getrlimit ()
Packit 7cfc04
(slot
Packit 7cfc04
.IR __NR_getrlimit )
Packit 7cfc04
and
Packit 7cfc04
.IR sys_getrlimit ()
Packit 7cfc04
(slot
Packit 7cfc04
.IR __NR_ugetrlimit ).
Packit 7cfc04
.IP *
Packit 7cfc04
Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
Packit 7cfc04
.\" 64-bit off_t changes: ftruncate64, *stat64,
Packit 7cfc04
.\" fcntl64 (because of the flock structure), getdents64, *statfs64
Packit 7cfc04
To support this change, a range of system calls were added
Packit 7cfc04
(e.g.,
Packit 7cfc04
.BR chown32 (2),
Packit 7cfc04
.BR getuid32 (2),
Packit 7cfc04
.BR getgroups32 (2),
Packit 7cfc04
.BR setresuid32 (2)),
Packit 7cfc04
superseding earlier calls of the same name without the
Packit 7cfc04
"32" suffix.
Packit 7cfc04
.IP *
Packit 7cfc04
Linux 2.4 added support for applications on 32-bit architectures
Packit 7cfc04
to access large files (i.e., files for which the sizes and
Packit 7cfc04
file offsets can't be represented in 32 bits.)
Packit 7cfc04
To support this change, replacements were required for system calls
Packit 7cfc04
that deal with file offsets and sizes.
Packit 7cfc04
Thus the following system calls were added:
Packit 7cfc04
.BR fcntl64 (2),
Packit 7cfc04
.BR getdents64 (2),
Packit 7cfc04
.BR stat64 (2),
Packit 7cfc04
.BR statfs64 (2),
Packit 7cfc04
.BR truncate64 (2),
Packit 7cfc04
and their analogs that work with file descriptors or
Packit 7cfc04
symbolic links.
Packit 7cfc04
These system calls supersede the older system calls
Packit 7cfc04
which, except in the case of the "stat" calls,
Packit 7cfc04
have the same name without the "64" suffix.
Packit 7cfc04
.IP
Packit 7cfc04
On newer platforms that only have 64-bit file access and 32-bit UIDs/GIDs
Packit 7cfc04
(e.g., alpha, ia64, s390x, x86-64), there is just a single version of
Packit 7cfc04
the UID/GID and file access system calls.
Packit 7cfc04
On platforms (typically, 32-bit platforms) where the *64 and *32 calls exist,
Packit 7cfc04
the other versions are obsolete.
Packit 7cfc04
.IP *
Packit 7cfc04
The
Packit 7cfc04
.I rt_sig*
Packit 7cfc04
calls were added in kernel 2.2 to support the addition
Packit 7cfc04
of real-time signals (see
Packit 7cfc04
.BR signal (7)).
Packit 7cfc04
These system calls supersede the older system calls of the same
Packit 7cfc04
name without the "rt_" prefix.
Packit 7cfc04
.IP *
Packit 7cfc04
The
Packit 7cfc04
.BR select (2)
Packit 7cfc04
and
Packit 7cfc04
.BR mmap (2)
Packit 7cfc04
system calls use five or more arguments,
Packit 7cfc04
which caused problems in the way
Packit 7cfc04
argument passing on the i386 used to be set up.
Packit 7cfc04
Thus, while other architectures have
Packit 7cfc04
.IR sys_select ()
Packit 7cfc04
and
Packit 7cfc04
.IR sys_mmap ()
Packit 7cfc04
corresponding to
Packit 7cfc04
.I __NR_select
Packit 7cfc04
and
Packit 7cfc04
.IR __NR_mmap ,
Packit 7cfc04
on i386 one finds
Packit 7cfc04
.IR old_select ()
Packit 7cfc04
and
Packit 7cfc04
.IR old_mmap ()
Packit 7cfc04
(routines that use a pointer to an
Packit 7cfc04
argument block) instead.
Packit 7cfc04
These days passing five arguments
Packit 7cfc04
is not a problem any more, and there is a
Packit 7cfc04
.I __NR__newselect
Packit 7cfc04
.\" (used by libc 6)
Packit 7cfc04
that corresponds directly to
Packit 7cfc04
.IR sys_select ()
Packit 7cfc04
and similarly
Packit 7cfc04
.IR __NR_mmap2 .
Packit 7cfc04
.\" .PP
Packit 7cfc04
.\" Two system call numbers,
Packit 7cfc04
.\" .IR __NR__llseek
Packit 7cfc04
.\" and
Packit 7cfc04
.\" .IR __NR__sysctl
Packit 7cfc04
.\" have an additional underscore absent in
Packit 7cfc04
.\" .IR sys_llseek ()
Packit 7cfc04
.\" and
Packit 7cfc04
.\" .IR sys_sysctl ().
Packit 7cfc04
.\"
Packit 7cfc04
.\" In kernel 2.1.81,
Packit 7cfc04
.\" .BR lchown (2)
Packit 7cfc04
.\" and
Packit 7cfc04
.\" .BR chown (2)
Packit 7cfc04
.\" were swapped; that is,
Packit 7cfc04
.\" .BR lchown (2)
Packit 7cfc04
.\" was added with the semantics that were then current for
Packit 7cfc04
.\" .BR chown (2),
Packit 7cfc04
.\" and the semantics of the latter call were changed to what
Packit 7cfc04
.\" they are today.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR intro (2),
Packit 7cfc04
.BR syscall (2),
Packit 7cfc04
.BR unimplemented (2),
Packit 7cfc04
.BR errno (3),
Packit 7cfc04
.BR libc (7),
Packit 7cfc04
.BR vdso (7)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.