]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/syscalls.2
syscalls.2: Add version information for all (other) syscalls
[thirdparty/man-pages.git] / man2 / syscalls.2
CommitLineData
c11b1abf 1.\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
09de4bf1
MK
2.\" with some input from Stepan Kasal <kasal@ucw.cz>
3.\"
4.\" Some content retained from an earlier version of this page:
fea681da
MK
5.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl)
6.\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern
7.\" <redferni@logica.com>
8.\"
93015253 9.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
10.\" Permission is granted to make and distribute verbatim copies of this
11.\" manual provided the copyright notice and this permission notice are
12.\" preserved on all copies.
13.\"
14.\" Permission is granted to copy and distribute modified versions of this
15.\" manual under the conditions for verbatim copying, provided that the
16.\" entire resulting derived work is distributed under the terms of a
17.\" permission notice identical to this one.
18.\"
19.\" Since the Linux kernel and libraries are constantly changing, this
20.\" manual page may be incorrect or out-of-date. The author(s) assume no
21.\" responsibility for errors or omissions, or for damages resulting from
22.\" the use of the information contained herein. The author(s) may not
23.\" have taken the same level of care in the production of this manual,
24.\" which is licensed free of charge, as they might when working
25.\" professionally.
26.\"
27.\" Formatted or processed versions of this manual, if unaccompanied by
28.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 29.\" %%%LICENSE_END
fea681da 30.\"
8717e79e 31.TH SYSCALLS 2 2012-03-07 "Linux" "Linux Programmer's Manual"
fea681da 32.SH NAME
09de4bf1 33syscalls \- Linux system calls
fea681da 34.SH SYNOPSIS
09de4bf1 35Linux system calls.
fea681da
MK
36.SH DESCRIPTION
37The system call is the fundamental interface between an application
c13182ef 38and the Linux kernel.
7d50a840
MK
39.SS System calls and library wrapper functions
40System calls are generally not invoked directly,
61d7d93c
MK
41but rather via wrapper functions in glibc (or perhaps some other library).
42For details of direct invocation of a system call, see
43.BR intro (2).
7d50a840
MK
44Often, but not always, the name of the wrapper function is the same
45as the name of the system call that it invokes.
46For example, glibc contains a function
47.BR truncate ()
48which invokes the underlying "truncate" system call.
fea681da 49
7d50a840 50Often the glibc wrapper function is quite thin, doing little work
c8bd05f9
MK
51other than copying arguments to the right registers
52before invoking the system call,
53and then setting
54.I errno
55appropriately after the system call has returned.
56(These are the same steps that are performed by
57.BR syscall (2),
58which can be used to invoke system calls
59for which no wrapper function is provided.)
60Note: system calls indicate a failure by returning a negative error
61number to the caller;
62when this happens,
63the wrapper function negates the returned error number
64(to make it positive), copies it to
65.IR errno ,
66and returns \-1 to the caller of the wrapper.
7d50a840
MK
67
68Sometimes, however, the wrapper function does some extra work
69before invoking the system call.
70For example, nowadays there are (for reasons described below) two
71related system calls,
72.BR truncate (2)
73and
74.BR truncate64 (2),
75and the glibc
76.BR truncate ()
61d7d93c
MK
77wrapper function checks which of those system calls
78are provided by the kernel and determines which should be employed.
7d50a840 79.SS System call list
1ce7088e 80Below is a list of the Linux system calls.
09de4bf1
MK
81In the list, the
82.I Kernel
83column indicates the kernel version
84for those system calls that were new in Linux 2.2,
85or have appeared since that kernel version.
86Note the following points:
87.IP * 3
88Where no kernel version is indicated,
dc2f5549
MK
89the system call appeared in kernel 1.0 or earlier.
90.IP *
91Where a system call is marked "1.2"
92this means the system call probably appeared in a 1.1.x kernel version,
93and first appeared in a stable kernel with 1.2.
94(Development of the 1.2 kernel was initiated from a branch of kernel
951.0.6 via the 1.1.x unstable kernel series.)
96.IP *
97Where a system call is marked "2.0"
98this means the system call probably appeared in a 1.3.x kernel version,
99and first appeared in a stable kernel with 2.0.
100(Development of the 2.0 kernel was initiated from a branch of kernel
1011.2.x, somewhere around 1.2.10,
102via the 1.3.x unstable kernel series.)
d6ce4960
MK
103.\" Was kernel 2.0 started from a branch of 1.2.10?
104.\" At least from the timestamps of the tarballs of
105.\" of 1.2.10 and 1.3.0, that's how it looks, but in
e0bf9127 106.\" fact the diff doesn't seem very clear, the
d6ce4960
MK
107.\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the
108.\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the
109.\" timestamps of some files in 1.3.0 seem to be older
110.\" than those in 1.2.10. All of this suggests
111.\" that there might not have been a clean branch point.
09de4bf1
MK
112.IP *
113Where a system call is marked "2.2"
114this means the system call probably appeared in a 2.1.x kernel version,
115and first appeared in a stable kernel with 2.2.0.
f9e4d811
MK
116(Development of the 2.2 kernel was initiated from a branch of kernel
1172.0.21 via the 2.1.x unstable kernel series.)
09de4bf1
MK
118.IP *
119Where a system call is marked "2.4"
120this means the system call probably appeared in a 2.3.x kernel version,
121and first appeared in a stable kernel with 2.4.0.
f9e4d811
MK
122(Development of the 2.4 kernel was initiated from a branch of
123kernel 2.2.8 via the 2.3.x unstable kernel series.)
09de4bf1
MK
124.IP *
125Where a system call is marked "2.6"
126this means the system call probably appeared in a 2.5.x kernel version,
127and first appeared in a stable kernel with 2.6.0.
f9e4d811
MK
128(Development of kernel 2.6 was initiated from a branch
129of kernel 2.4.15 via the 2.5.x unstable kernel series.)
09de4bf1
MK
130.IP *
131Starting with kernel 2.6.0, the development model changed,
132and new system calls may appear in each 2.6.x release.
f9e4d811
MK
133In this case, the exact version number where the system call appeared
134is shown.
c39f51b0
MK
135This convention continues with the 3.x kernel series,
136which followed on from kernel 2.6.39.
f9e4d811
MK
137.IP *
138In some cases, a system call was added to a stable kernel
139series after it branched from the previous stable kernel
140series, and then backported into the earlier stable kernel series.
141For example some system calls that appeared in 2.6.x were also backported
142into a 2.4.x release after 2.4.15.
143When this is so, the version where the system call appeared
09de4bf1 144in both of the major kernel series is listed.
09de4bf1 145.PP
8eec4a23 146The list of system calls that are available as at kernel 3.5
09de4bf1
MK
147(or in a few cases only on older kernels) is as follows:
148.\"
149.\" Looking at scripts/checksyscalls.sh in the kernel source is
929f1ff7 150.\" instructive about x86 specifics.
09de4bf1 151.\"
56f2caff 152.ad l
09de4bf1 153.TS
7d50a840
MK
154l l l
155---
09de4bf1 156l l l.
e2f9e1be 157\fBSystem call\fP \fBKernel\fP \fBNotes\fP
3fffa7b6 158
dc2f5549 159\fB_llseek\fP(2) 1.2
8717e79e
MK
160\fB_newselect\fP(2) 2.0
161\fB_sysctl\fP(2) 2.0
162\fBaccept\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
53e819d0 163\fBaccept4\fP(2) 2.6.28
8717e79e
MK
164\fBaccess\fP(2) 1.0
165\fBacct\fP(2) 1.0
09de4bf1 166\fBadd_key\fP(2) 2.6.11
8717e79e
MK
167\fBadjtimex\fP(2) 1.0
168\fBalarm\fP(2) 1.0
f9e4d811 169\fBalloc_hugepages\fP(2) 2.5.36 Removed in 2.5.44
8717e79e 170\fBbdflush\fP(2) 1.2 T{
56f2caff
BIG
171Deprecated (does nothing) since 2.6
172T}
8717e79e
MK
173\fBbind\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
174\fBbrk\fP(2) 1.0
929f1ff7 175\fBcacheflush\fP(2) 1.2 Not on x86
09de4bf1
MK
176\fBcapget\fP(2) 2.2
177\fBcapset\fP(2) 2.2
8717e79e
MK
178\fBchdir\fP(2) 1.0
179\fBchmod\fP(2) 1.0
180\fBchown\fP(2) 2.2 T{
181See \fBchown\fP(2) for version details
182T}
09de4bf1 183\fBchown32\fP(2) 2.4
8717e79e 184\fBchroot\fP(2) 1.0
b9cad55b 185\fBclock_adjtime\fP(2) 2.6.39
09de4bf1
MK
186\fBclock_getres\fP(2) 2.6
187\fBclock_gettime\fP(2) 2.6
188\fBclock_nanosleep\fP(2) 2.6
189\fBclock_settime\fP(2) 2.6
8717e79e
MK
190\fBclone\fP(2) 1.0
191\fBclose\fP(2) 1.0
192\fBconnect\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
193\fBcreat\fP(2) 1.0
56f2caff 194\fBcreate_module\fP(2) Removed in 2.6
8717e79e
MK
195\fBdelete_module\fP(2) 1.0
196\fBdup\fP(2) 1.0
197\fBdup2\fP(2) 1.0
eb153420 198\fBdup3\fP(2) 2.6.27
09de4bf1 199\fBepoll_create\fP(2) 2.6
eb153420 200\fBepoll_create1\fP(2) 2.6.27
09de4bf1
MK
201\fBepoll_ctl\fP(2) 2.6
202\fBepoll_pwait\fP(2) 2.6.19
203\fBepoll_wait\fP(2) 2.6
204\fBeventfd\fP(2) 2.6.22
eb153420 205\fBeventfd2\fP(2) 2.6.27
8717e79e
MK
206\fBexecve\fP(2) 1.0
207\fBexit\fP(2) 1.0
30fa088c 208\fBexit_group\fP(2) 2.6
09de4bf1 209\fBfaccessat\fP(2) 2.6.16
7d50a840
MK
210\fBfadvise64\fP(2) 2.6
211.\" Implements \fBposix_fadvise\fP(2)
212\fBfadvise64_64\fP(2) 2.6
6397da8c 213\fBfallocate\fP(2) 2.6.23
3610ae93
MK
214\fBfanotify_init\fP(2) 2.6.37
215\fBfanotify_mark\fP(2) 2.6.37
216.\" The fanotify calls were added in Linux 2.6.36,
217.\" but disabled while the API was finalized.
8717e79e
MK
218\fBfchdir\fP(2) 1.0
219\fBfchmod\fP(2) 1.0
09de4bf1 220\fBfchmodat\fP(2) 2.6.16
8717e79e 221\fBfchown\fP(2) 1.0
09de4bf1
MK
222\fBfchown32\fP(2) 2.4
223\fBfchownat\fP(2) 2.6.16
8717e79e 224\fBfcntl\fP(2) 1.0
09de4bf1 225\fBfcntl64\fP(2) 2.4
8717e79e 226\fBfdatasync\fP(2) 2.0
09de4bf1 227\fBfgetxattr\fP(2) 2.6; 2.4.18
ecbb4bb7 228\fBfinit_module\fP(2) 3.8
09de4bf1 229\fBflistxattr\fP(2) 2.6; 2.4.18
dc2f5549 230\fBflock\fP(2) 2.0
8717e79e 231\fBfork\fP(2) 1.0
f9e4d811 232\fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44
09de4bf1
MK
233\fBfremovexattr\fP(2) 2.6; 2.4.18
234\fBfsetxattr\fP(2) 2.6; 2.4.18
8717e79e 235\fBfstat\fP(2) 1.0
09de4bf1 236\fBfstat64\fP(2) 2.4
f6b8bc07 237\fBfstatat64\fP(2) 2.6.16
8717e79e 238\fBfstatfs\fP(2) 1.0
09de4bf1 239\fBfstatfs64\fP(2) 2.6
8717e79e
MK
240\fBfsync\fP(2) 1.0 1.0
241\fBftruncate\fP(2) 1.0
09de4bf1 242\fBftruncate64\fP(2) 2.4
30fa088c 243\fBfutex\fP(2) 2.6
09de4bf1 244\fBfutimesat\fP(2) 2.6.16
56f2caff 245\fBget_kernel_syms\fP(2) Removed in 2.6
09de4bf1
MK
246\fBget_mempolicy\fP(2) 2.6.6
247\fBget_robust_list\fP(2) 2.6.17
30fa088c 248\fBget_thread_area\fP(2) 2.6
09de4bf1
MK
249\fBgetcpu\fP(2) 2.6.19
250\fBgetcwd\fP(2) 2.2
dc2f5549 251\fBgetdents\fP(2) 2.0
09de4bf1 252\fBgetdents64\fP(2) 2.4
8717e79e 253\fBgetegid\fP(2) 1.0
09de4bf1 254\fBgetegid32\fP(2) 2.4
8717e79e 255\fBgeteuid\fP(2) 1.0
09de4bf1 256\fBgeteuid32\fP(2) 2.4
8717e79e 257\fBgetgid\fP(2) 1.0
09de4bf1 258\fBgetgid32\fP(2) 2.4
8717e79e 259\fBgetgroups\fP(2) 1.0
09de4bf1 260\fBgetgroups32\fP(2) 2.4
8717e79e
MK
261\fBgetitimer\fP(2) 1.0
262\fBgetpeername\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
929f1ff7 263\fBgetpagesize\fP(2) 2.0 Not on x86
8717e79e
MK
264\fBgetpgid\fP(2) 1.0
265\fBgetpgrp\fP(2) 1.0
266\fBgetpid\fP(2) 1.0
267\fBgetppid\fP(2) 1.0
268\fBgetpriority\fP(2) 1.0
09de4bf1
MK
269\fBgetresgid\fP(2) 2.2
270\fBgetresgid32\fP(2) 2.4
271\fBgetresuid\fP(2) 2.2
272\fBgetresuid32\fP(2) 2.4
8717e79e
MK
273\fBgetrlimit\fP(2) 1.0
274\fBgetrusage\fP(2) 1.0
dc2f5549 275\fBgetsid\fP(2) 2.0
8717e79e
MK
276\fBgetsockname\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
277\fBgetsockopt\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
09de4bf1 278\fBgettid\fP(2) 2.4.11
8717e79e
MK
279\fBgettimeofday\fP(2) 1.0
280\fBgetuid\fP(2) 1.0
09de4bf1 281\fBgetuid32\fP(2) 2.4
018991f6 282.\" \fBgetunwind\fP(2) 2.4.8 ia64; DEPRECATED
09de4bf1 283\fBgetxattr\fP(2) 2.6; 2.4.18
8717e79e 284\fBinit_module\fP(2) 1.0
09de4bf1
MK
285\fBinotify_add_watch\fP(2) 2.6.13
286\fBinotify_init\fP(2) 2.6.13
eb153420 287\fBinotify_init1\fP(2) 2.6.27
09de4bf1 288\fBinotify_rm_watch\fP(2) 2.6.13
30fa088c
MK
289\fBio_cancel\fP(2) 2.6
290\fBio_destroy\fP(2) 2.6
291\fBio_getevents\fP(2) 2.6
292\fBio_setup\fP(2) 2.6
293\fBio_submit\fP(2) 2.6
8717e79e
MK
294\fBioctl\fP(2) 1.0
295\fBioperm\fP(2) 1.0
296\fBiopl\fP(2) 1.0
09de4bf1
MK
297\fBioprio_get\fP(2) 2.6.13
298\fBioprio_set\fP(2) 2.6.13
8717e79e 299\fBipc\fP(2) 1.0
7d50a840 300.\" Implements System V IPC calls
8eec4a23 301\fBkcmp\fP(2) 3.5
29cb9035 302\fBkern_features\fP(2) 3.7 Sparc64
3ed3a507
MK
303\fBkexec_load\fP(2) 2.6.13
304.\" The entry in the syscall table was reserved starting in 2.6.7
7d50a840 305.\" Was named sys_kexec_load() from 2.6.7 to 2.6.16
09de4bf1 306\fBkeyctl\fP(2) 2.6.11
8717e79e
MK
307\fBkill\fP(2) 1.0
308\fBlchown\fP(2) 1.0 T{
309See \fBchown\fP(2) for version details
310T}
09de4bf1
MK
311\fBlchown32\fP(2) 2.4
312\fBlgetxattr\fP(2) 2.6; 2.4.18
8717e79e 313\fBlink\fP(2) 1.0
09de4bf1 314\fBlinkat\fP(2) 2.6.16
8717e79e 315\fBlisten\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
09de4bf1
MK
316\fBlistxattr\fP(2) 2.6; 2.4.18
317\fBllistxattr\fP(2) 2.6; 2.4.18
09de4bf1
MK
318\fBlookup_dcookie\fP(2) 2.6
319\fBlremovexattr\fP(2) 2.6; 2.4.18
8717e79e 320\fBlseek\fP(2) 1.0
09de4bf1 321\fBlsetxattr\fP(2) 2.6; 2.4.18
8717e79e 322\fBlstat\fP(2) 1.0
09de4bf1
MK
323\fBlstat64\fP(2) 2.4
324\fBmadvise\fP(2) 2.4
325\fBmadvise1\fP(2) 2.4
326\fBmbind\fP(2) 2.6.6
327.\" \fBmemory_ordering\fP(2) ??? Sparc64
328\fBmigrate_pages\fP(2) 2.6.16
329\fBmincore\fP(2) 2.4
8717e79e 330\fBmkdir\fP(2) 1.0
09de4bf1 331\fBmkdirat\fP(2) 2.6.16
8717e79e 332\fBmknod\fP(2) 1.0
09de4bf1 333\fBmknodat\fP(2) 2.6.16
8717e79e
MK
334\fBmlock\fP(2) 2.0
335\fBmlockall\fP(2) 2.0
336\fBmmap\fP(2) 1.0
09de4bf1 337\fBmmap2\fP(2) 2.4
8717e79e
MK
338\fBmodify_ldt\fP(2) 1.0
339\fBmount\fP(2) 1.0
09de4bf1 340\fBmove_pages\fP(2) 2.6.18
8717e79e 341\fBmprotect\fP(2) 1.0
7d50a840
MK
342\fBmq_getsetattr\fP(2) 2.6.6
343.\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
09de4bf1
MK
344\fBmq_notify\fP(2) 2.6.6
345\fBmq_open\fP(2) 2.6.6
346\fBmq_timedreceive\fP(2) 2.6.6
347\fBmq_timedsend\fP(2) 2.6.6
8717e79e 348\fBmq_unlink\fP(2) 2.6.6
dc2f5549 349\fBmremap\fP(2) 2.0
8717e79e
MK
350\fBmsgctl\fP(2) 2.0 See notes on \fBipc\fP(2)
351\fBmsgget\fP(2) 2.0 See notes on \fBipc\fP(2)
352\fBmsgrcv\fP(2) 2.0 See notes on \fBipc\fP(2)
353\fBmsgsnd\fP(2) 2.0 See notes on \fBipc\fP(2)
dc2f5549 354\fBmsync\fP(2) 2.0
af4c9a82
MK
355.\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on
356.\" PowerPC, but unimplemented?
8717e79e
MK
357\fBmunlock\fP(2) 2.0
358\fBmunlockall\fP(2) 2.0
359\fBmunmap\fP(2) 1.0
b9cad55b 360\fBname_to_handle_at\fP(2) 2.6.39
dc2f5549 361\fBnanosleep\fP(2) 2.0
18a97acf 362\fBnfsservctl\fP(2) 2.2 Removed in 3.1
8717e79e
MK
363\fBnice\fP(2) 1.0
364\fBoldfstat\fP(2) 1.0
365\fBoldlstat\fP(2) 1.0
366\fBoldolduname\fP(2) 1.0
367\fBoldstat\fP(2) 1.0
368\fBolduname\fP(2) 1.0
369\fBopen\fP(2) 1.0
b9cad55b 370\fBopen_by_handle_at\fP(2) 2.6.39
09de4bf1 371\fBopenat\fP(2) 2.6.16
8717e79e 372\fBpause\fP(2) 1.0
929f1ff7
MK
373\fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on x86
374.\" Alpha, PowerPC, ARM; not x86
375\fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on x86
376.\" , PowerPC, ARM; not x86
377\fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on x86
378.\" , PowerPC, ARM; not x86
56f2caff
BIG
379\fBperf_event_open\fP(2) 2.6.31 T{
380Was called perf_counter_open() in 2.6.31; renamed in 2.6.32
381T}
dc2f5549 382\fBpersonality\fP(2) 1.2
7ddff6a4
MK
383\fBperfctr\fP(2) 2.2 Sparc; removed in 2.6.34
384.\" commit c7d5a0050773e98d1094eaa9f2a1a793fafac300 removed perfctr()
22399250 385.\" \fBperfmonctl\fP(2) ??? ia64
8717e79e 386\fBpipe\fP(2) 1.0
eb153420 387\fBpipe2\fP(2) 2.6.27
dc2f5549 388\fBpivot_root\fP(2) 2.4
8717e79e 389\fBpoll\fP(2) 2.0.36; 2.2
c071b8e0 390\fBppc_rtas\fP(2) PowerPC only
09de4bf1
MK
391\fBppoll\fP(2) 2.6.16
392\fBprctl\fP(2) 2.2
56f2caff
BIG
393\fBpread64\fP(2) T{
394Added as "pread" in 2.2; renamed "pread64" in 2.6
395T}
0877a26b 396\fBpreadv\fP(2) 2.6.30
940795c0 397\fBprlimit\fP(2) 2.6.36
f06f5014
DP
398\fBprocess_vm_readv\fP(2) 3.2
399\fBprocess_vm_writev\fP(2) 3.2
7d50a840
MK
400\fBpselect6\fP(2) 2.6.16
401.\" Implements \fBpselect\fP(2)
8717e79e 402\fBptrace\fP(2) 1.0
56f2caff
BIG
403\fBpwrite64\fP(2) T{
404Added as "pwrite" in 2.2; renamed "pwrite64" in 2.6
405T}
0877a26b 406\fBpwritev\fP(2) 2.6.30
13f66890 407\fBquery_module\fP(2) 2.2 Removed in 2.6
8717e79e
MK
408\fBquotactl\fP(2) 1.0
409\fBread\fP(2) 1.0
09de4bf1 410\fBreadahead\fP(2) 2.4.13
8717e79e 411\fBreaddir\fP(2) 1.0
7d50a840 412.\" Supersedes \fBgetdents\fP(2)
8717e79e 413\fBreadlink\fP(2) 1.0
09de4bf1 414\fBreadlinkat\fP(2) 2.6.16
dc2f5549 415\fBreadv\fP(2) 2.0
8717e79e
MK
416\fBreboot\fP(2) 1.0
417\fBrecv\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
418\fBrecvfrom\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
419\fBrecvmsg\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
285bf67e 420\fBrecvmmsg\fP(2) 2.6.33
09de4bf1
MK
421\fBremap_file_pages\fP(2) 2.6
422\fBremovexattr\fP(2) 2.6; 2.4.18
8717e79e 423\fBrename\fP(2) 1.0
09de4bf1
MK
424\fBrenameat\fP(2) 2.6.16
425\fBrequest_key\fP(2) 2.6.11
426\fBrestart_syscall\fP(2) 2.6
8717e79e 427\fBrmdir\fP(2) 1.0
09de4bf1
MK
428\fBrt_sigaction\fP(2) 2.2
429\fBrt_sigpending\fP(2) 2.2
430\fBrt_sigprocmask\fP(2) 2.2
7d50a840 431\fBrt_sigqueueinfo\fP(2) 2.2
09de4bf1
MK
432\fBrt_sigreturn\fP(2) 2.2
433\fBrt_sigsuspend\fP(2) 2.2
434\fBrt_sigtimedwait\fP(2) 2.2
285bf67e 435\fBrt_tgsigqueueinfo\fP(2) 2.6.31
993d1ce3 436\fBs390_runtime_instr\fP(2) 3.7 s390 only
dc2f5549
MK
437\fBsched_get_priority_max\fP(2) 2.0
438\fBsched_get_priority_min\fP(2) 2.0
30fa088c 439\fBsched_getaffinity\fP(2) 2.6
dc2f5549
MK
440\fBsched_getparam\fP(2) 2.0
441\fBsched_getscheduler\fP(2) 2.0
442\fBsched_rr_get_interval\fP(2) 2.0
30fa088c 443\fBsched_setaffinity\fP(2) 2.6
dc2f5549
MK
444\fBsched_setparam\fP(2) 2.0
445\fBsched_setscheduler\fP(2) 2.0
446\fBsched_yield\fP(2) 2.0
8717e79e
MK
447\fBselect\fP(2) 1.0
448\fBsemctl\fP(2) 2.0 See notes on \fBipc\fP(2)
449\fBsemget\fP(2) 2.0 See notes on \fBipc\fP(2)
450\fBsemop\fP(2) 2.0 See notes on \fBipc\fP(2)
09de4bf1 451\fBsemtimedop\fP(2) 2.6; 2.4.22
8717e79e 452\fBsend\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
09de4bf1
MK
453\fBsendfile\fP(2) 2.2
454\fBsendfile64\fP(2) 2.6; 2.4.19
3e55b0bd 455\fBsendmmsg\fP(2) 3.0
8717e79e
MK
456\fBsendmsg\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
457\fBsendto\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
09de4bf1
MK
458\fBset_mempolicy\fP(2) 2.6.6
459\fBset_robust_list\fP(2) 2.6.17
30fa088c 460\fBset_thread_area\fP(2) 2.6
09de4bf1 461\fBset_tid_address\fP(2) 2.6
9947a8d7
MK
462.\" See http://lkml.org/lkml/2005/8/1/83
463.\" "[PATCH] remove sys_set_zone_reclaim()"
8717e79e 464\fBsetdomainname\fP(2) 1.0
dc2f5549 465\fBsetfsgid\fP(2) 1.2
09de4bf1 466\fBsetfsgid32\fP(2) 2.4
dc2f5549 467\fBsetfsuid\fP(2) 1.2
09de4bf1 468\fBsetfsuid32\fP(2) 2.4
8717e79e 469\fBsetgid\fP(2) 1.0
09de4bf1 470\fBsetgid32\fP(2) 2.4
8717e79e 471\fBsetgroups\fP(2) 1.0
09de4bf1 472\fBsetgroups32\fP(2) 2.4
8717e79e
MK
473\fBsethostname\fP(2) 1.0
474\fBsetitimer\fP(2) 1.0
3e55b0bd 475\fBsetns\fP(2) 3.0
8717e79e
MK
476\fBsetpgid\fP(2) 1.0
477\fBsetpriority\fP(2) 1.0
478\fBsetregid\fP(2) 1.0
09de4bf1
MK
479\fBsetregid32\fP(2) 2.4
480\fBsetresgid\fP(2) 2.2
481\fBsetresgid32\fP(2) 2.4
482\fBsetresuid\fP(2) 2.2
483\fBsetresuid32\fP(2) 2.4
8717e79e 484\fBsetreuid\fP(2) 1.0
09de4bf1 485\fBsetreuid32\fP(2) 2.4
8717e79e
MK
486\fBsetrlimit\fP(2) 1.0
487\fBsetsid\fP(2) 1.0
488\fBsetsockopt\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
489\fBsettimeofday\fP(2) 1.0
490\fBsetuid\fP(2) 1.0
09de4bf1
MK
491\fBsetuid32\fP(2) 2.4
492\fBsetup\fP(2) Removed in 2.2
493\fBsetxattr\fP(2) 2.6; 2.4.18
8717e79e
MK
494\fBsgetmask\fP(2) 1.0
495\fBshmat\fP(2) 2.0 See notes on \fBipc\fP(2)
496\fBshmctl\fP(2) 2.0 See notes on \fBipc\fP(2)
497\fBshmdt\fP(2) 2.0 See notes on \fBipc\fP(2)
498\fBshmget\fP(2) 2.0 See notes on \fBipc\fP(2)
499\fBshutdown\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
500\fBsigaction\fP(2) 1.0
09de4bf1 501\fBsigaltstack\fP(2) 2.2
8717e79e 502\fBsignal\fP(2) 1.0
09de4bf1 503\fBsignalfd\fP(2) 2.6.22
eb153420 504\fBsignalfd4\fP(2) 2.6.27
8717e79e
MK
505\fBsigpending\fP(2) 1.0
506\fBsigprocmask\fP(2) 1.0
507\fBsigreturn\fP(2) 1.0
508\fBsigsuspend\fP(2) 1.0
509\fBsocket\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
510\fBsocketcall\fP(2) 1.0
7d50a840 511.\" Implements BSD socket calls
8717e79e 512\fBsocketpair\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
09de4bf1 513\fBsplice\fP(2) 2.6.17
f9e4d811
MK
514\fBspu_create\fP(2) 2.6.16 PowerPC only
515\fBspu_run\fP(2) 2.6.16 PowerPC only
8717e79e
MK
516\fBssetmask\fP(2) 1.0
517\fBstat\fP(2) 1.0
09de4bf1 518\fBstat64\fP(2) 2.4
8717e79e 519\fBstatfs\fP(2) 1.0
09de4bf1 520\fBstatfs64\fP(2) 2.6
8717e79e 521\fBstime\fP(2) 1.0
56f2caff
BIG
522\fBsubpage_prot\fP(2) 2.6.25 PowerPC if
523 CONFIG_PPC_64K_PAGES
8717e79e
MK
524\fBswapoff\fP(2) 1.0
525\fBswapon\fP(2) 1.0
526\fBsymlink\fP(2) 1.0
09de4bf1 527\fBsymlinkat\fP(2) 2.6.16
8717e79e 528\fBsync\fP(2) 1.0
09de4bf1 529\fBsync_file_range\fP(2) 2.6.17
56f2caff
BIG
530\fBsync_file_range2\fP(2) 2.6.22 T{
531Architecture-specific variant of \fBsync_file_range\fP(2)
532T}
83225c1f
MK
533.\" PowerPC, ARM, tile
534.\" First appeared on ARM, as arm_sync_file_range(), but later renamed
af4c9a82 535.\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32
dc43a891 536\fBsyncfs\fP(2) 2.6.39
dc2f5549 537\fBsysfs\fP(2) 1.2
8717e79e
MK
538\fBsysinfo\fP(2) 1.0
539\fBsyslog\fP(2) 1.0
7d50a840 540.\" glibc interface is \fBklogctl\fP(3)
09de4bf1
MK
541\fBtee\fP(2) 2.6.17
542\fBtgkill\fP(2) 2.6
8717e79e 543\fBtime\fP(2) 1.0
09de4bf1
MK
544\fBtimer_create\fP(2) 2.6
545\fBtimer_delete\fP(2) 2.6
546\fBtimer_getoverrun\fP(2) 2.6
547\fBtimer_gettime\fP(2) 2.6
548\fBtimer_settime\fP(2) 2.6
0df29603
MK
549\fBtimerfd_create\fP(2) 2.6.25
550\fBtimerfd_gettime\fP(2) 2.6.25
551\fBtimerfd_settime\fP(2) 2.6.25
8717e79e 552\fBtimes\fP(2) 1.0
09de4bf1 553\fBtkill\fP(2) 2.6; 2.4.22
8717e79e 554\fBtruncate\fP(2) 1.0
09de4bf1
MK
555\fBtruncate64\fP(2) 2.4
556\fBugetrlimit\fP(2) 2.4
8717e79e
MK
557\fBumask\fP(2) 1.0
558\fBumount\fP(2) 1.0
09de4bf1
MK
559.\" sys_oldumount() -- __NR_umount
560\fBumount2\fP(2) 2.2
561.\" sys_umount() -- __NR_umount2
8717e79e
MK
562\fBuname\fP(2) 1.0
563\fBunlink\fP(2) 1.0
09de4bf1
MK
564\fBunlinkat\fP(2) 2.6.16
565\fBunshare\fP(2) 2.6.16
8717e79e
MK
566\fBuselib\fP(2) 1.0
567\fBustat\fP(2) 1.0
568\fButime\fP(2) 1.0
09de4bf1 569\fButimensat\fP(2) 2.6.22
d3ea5e99 570\fButimes\fP(2) 2.2
823c799b 571\fButrap_install\fP(2) 2.2 Sparc
8717e79e
MK
572\fBvfork\fP(2) 2.2
573\fBvhangup\fP(2) 1.0
574\fBvm86old\fP(2) 1.0 Was "vm86"; renamed in 2.0.28/2.2
575\fBvm86\fP(2) 2.0.28; 2.2
09de4bf1 576\fBvmsplice\fP(2) 2.6.17
8717e79e 577\fBwait4\fP(2) 1.0
09de4bf1 578\fBwaitid\fP(2) 2.6.10
8717e79e
MK
579\fBwaitpid\fP(2) 1.0
580\fBwrite\fP(2) 1.0
dc2f5549 581\fBwritev\fP(2) 2.0
09de4bf1 582.TE
56f2caff 583.ad
09de4bf1 584.PP
929f1ff7 585On many platforms, including x86-32, socket calls are all multiplexed
7d50a840
MK
586(via glibc wrapper functions) through
587.BR socketcall (2)
588and similarly System V IPC calls are multiplexed through
589.BR ipc (2).
0597933f 590
09de4bf1 591Although slots are reserved for them in the system call table,
e0bf9127 592the following system calls are not implemented in the standard kernel:
09de4bf1
MK
593.BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
594.BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386
595.BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386
596.BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386
597.BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386
598.BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386
599.BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386
600.BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386
601.BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386
3b777aff 602.BR phys (2), \" Slot has been reused
09de4bf1
MK
603.BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386
604.BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386
605.BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386
f9e4d811
MK
606.\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
607.\" on a couple of 2.6 architectures
608.BR security (2), \" __NR_security is 223 on Linux 2.4/i386
0597933f 609.\" The security call is for future use.
09de4bf1 610.BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386
af4c9a82 611.BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
09de4bf1
MK
612.BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386
613and
614.BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386
fea681da 615(see also
fea681da
MK
616.BR unimplemented (2)).
617However,
618.BR ftime (3),
619.BR profil (3)
620and
621.BR ulimit (3)
622exist as library routines.
09de4bf1
MK
623The slot for
624.BR phys (2)
625is in use since kernel 2.1.116 for
626.BR umount (2);
e0bf9127 627.BR phys (2)
09de4bf1 628will never be implemented.
09de4bf1
MK
629The
630.BR getpmsg (2)
631and
632.BR putpmsg (2)
633calls are for kernels patched to support STREAMS,
634and may never be in the standard kernel.
98309d3f
MK
635
636There was briefly
637.BR set_zone_reclaim (2),
638added in Linux 2.6.13, and removed in 2.6.16;
7fac88a9 639this system call was never available to user space.
0597933f 640.SH NOTES
09de4bf1 641.PP
fea681da
MK
642Roughly speaking, the code belonging to the system call
643with number __NR_xxx defined in
644.I /usr/include/asm/unistd.h
66a9882e 645can be found in the Linux kernel source in the routine
63aa9df0 646.IR sys_xxx ().
fea681da
MK
647(The dispatch table for i386 can be found in
648.IR /usr/src/linux/arch/i386/kernel/entry.S .)
649There are many exceptions, however, mostly because
650older system calls were superseded by newer ones,
c13182ef
MK
651and this has been treated somewhat unsystematically.
652On platforms with
6c1544c1
MK
653proprietary operating-system emulation,
654such as parisc, sparc, sparc64 and alpha,
fea681da
MK
655there are many additional system calls; mips64 also contains a full
656set of 32-bit system calls.
fea681da 657
09de4bf1
MK
658Over time, changes to the interfaces of some system calls have been
659necessary.
660One reason for such changes was the need to increase the size of
661structures or scalar values passed to the system call.
7d50a840
MK
662Because of these changes, there are now various groups
663of related system calls
664(e.g.,
665.BR truncate (2)
666and
e04e8187 667.BR truncate64 (2))
7d50a840
MK
668which perform similar tasks, but which vary in
669details such as the size of their arguments.
670(As noted earlier, applications are generally unaware of this:
671the glibc wrapper functions do some work to ensure that the right
672system call is invoked, and that ABI compatibility is
673preserved for old binaries.)
09de4bf1
MK
674Examples of systems calls that exist in multiple versions are
675the following:
676.IP * 3
7d50a840 677By now there are three different versions of
09de4bf1
MK
678.BR stat (2):
679.IR sys_stat ()
680(slot
681.IR __NR_oldstat ),
682.IR sys_newstat ()
683(slot
684.IR __NR_stat ),
fea681da 685and
92a5f983 686.IR sys_stat64 ()
09de4bf1
MK
687(slot
688.IR __NR_stat64 ),
689with the last being the most current.
f9e4d811 690.\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
09de4bf1
MK
691.\" The stat system calls deal with three different data structures,
692.\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
693A similar story applies for
694.BR lstat (2)
695and
696.BR fstat (2).
697.IP *
698Similarly, the defines
699.IR __NR_oldolduname ,
700.IR __NR_olduname ,
701and
0daa9e92 702.I __NR_uname
09de4bf1
MK
703refer to the routines
704.IR sys_olduname (),
705.IR sys_uname ()
706and
707.IR sys_newuname ().
708.IP *
7d50a840 709In Linux 2.0, a new version of
09de4bf1
MK
710.BR vm86 (2)
711appeared, with the old and the new kernel routines being named
712.IR sys_vm86old ()
713and
714.IR sys_vm86 ().
715.IP *
7d50a840 716In Linux 2.4, a new version of
09de4bf1
MK
717.BR getrlimit (2)
718appeared, with the old and the new kernel routines being named
719.IR sys_old_getrlimit ()
720(slot
721.IR __NR_getrlimit )
722and
723.IR sys_getrlimit ()
724(slot
725.IR __NR_ugetrlimit ).
726.IP *
727Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
5024580d 728.\" 64-bit off_t changes: ftruncate64, *stat64,
09de4bf1
MK
729.\" fcntl64 (because of the flock structure), getdents64, *statfs64
730To support this change, a range of system calls were added
731(e.g.,
732.BR chown32 (2),
733.BR getuid32 (2),
734.BR getgroups32 (2),
735.BR setresuid32 (2)),
736superseding earlier calls of the same name without the
737"32" suffix.
738.IP *
739Linux 2.4 added support for applications on 32-bit architectures
740to access large files (i.e., files for which the sizes and
741file offsets can't be represented in 32 bits.)
742To support this change, replacements were required for system calls
743that deal with file offsets and sizes.
744Thus the following system calls were added:
745.BR fcntl64 (2),
746.BR ftruncate64 (2),
747.BR getdents64 (2),
748.BR stat64 (2),
749.BR statfs64 (2),
750and their analogs that work with file descriptors or
751symbolic links.
752These system calls supersede the older system calls
753which, except in the case of the "stat" calls,
754have the same name without the "64" suffix.
ca92ce95 755
09de4bf1
MK
756On newer platforms that only have 64-bit file access and 32-bit uids
757(e.g., alpha, ia64, s390x) there are no *64 or *32 calls.
758Where the *64 and *32 calls exist, the other versions are obsolete.
759.IP *
760The
761.I rt_sig*
762calls were added in kernel 2.2 to support the addition
763of real-time signals (see
764.BR signal (7)).
765These system calls supersede the older system calls of the same
766name without the "rt_" prefix.
767.IP *
7d50a840
MK
768The
769.BR select (2)
fea681da 770and
7d50a840 771.BR mmap (2)
c4bb193f 772system calls use five or more arguments,
208088b5 773which caused problems in the way
c4bb193f 774argument passing on the i386 used to be set up.
7d50a840 775Thus, while other architectures have
09de4bf1
MK
776.IR sys_select ()
777and
778.IR sys_mmap ()
779corresponding to
0daa9e92 780.I __NR_select
09de4bf1
MK
781and
782.IR __NR_mmap ,
783on i386 one finds
784.IR old_select ()
785and
786.IR old_mmap ()
787(routines that use a pointer to a
c4bb193f
MK
788argument block) instead.
789These days passing five arguments
09de4bf1 790is not a problem any more, and there is a
0daa9e92 791.I __NR__newselect
7d50a840
MK
792.\" (used by libc 6)
793that corresponds directly to
09de4bf1
MK
794.IR sys_select ()
795and similarly
7d50a840
MK
796.IR __NR_mmap2 .
797.\" .PP
798.\" Two system call numbers,
799.\" .IR __NR__llseek
800.\" and
801.\" .IR __NR__sysctl
802.\" have an additional underscore absent in
803.\" .IR sys_llseek ()
804.\" and
805.\" .IR sys_sysctl ().
e0bf9127 806.\"
7d50a840
MK
807.\" In kernel 2.1.81,
808.\" .BR lchown (2)
e0bf9127 809.\" and
7d50a840
MK
810.\" .BR chown (2)
811.\" were swapped; that is,
812.\" .BR lchown (2)
813.\" was added with the semantics that were then current for
814.\" .BR chown (2),
815.\" and the semantics of the latter call were changed to what
816.\" they are today.
09de4bf1
MK
817.SH SEE ALSO
818.BR syscall (2),
de9ed3a3
MK
819.BR unimplemented (2),
820.BR libc (7)