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