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