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