OSDN Git Service

(split) LDP: Update original to v3.37.
[linuxjm/LDP_man-pages.git] / original / man2 / syscalls.2
1 .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" with some input from Stepan Kasal <kasal@ucw.cz>
3 .\"
4 .\" Some content retained from an earlier version of this page:
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 .\"
29 .TH SYSCALLS 2 2012-03-05 "Linux" "Linux Programmer's Manual"
30 .SH NAME
31 syscalls \- Linux system calls
32 .SH SYNOPSIS
33 Linux system calls.
34 .SH DESCRIPTION
35 The system call is the fundamental interface between an application
36 and the Linux kernel.
37 .SS System calls and library wrapper functions
38 System calls are generally not invoked directly,
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).
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.
47
48 Often the glibc wrapper function is quite thin, doing little work
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.
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 ()
75 wrapper function checks which of those system calls
76 are provided by the kernel and determines which should be employed.
77 .SS System call list
78 Below is a list of those system calls that are common to most platforms.
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,
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.)
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
104 .\" fact the diff doesn't seem very clear, the
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.
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.
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.)
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.
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.)
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.
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.)
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.
131 In this case, the exact version number where the system call appeared
132 is shown.
133 This convention continues with the 3.x kernel series,
134 which followed on from kernel 2.6.39.
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
142 in both of the major kernel series is listed.
143 .PP
144 The list of system calls that are available as at kernel 3.1
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
148 .\" instructive about i386 specifics.
149 .\"
150 .TS
151 l l l
152 ---
153 l l l.
154 \fBSystem call\fP       \fBKernel\fP    \fBNotes\fP
155
156 \fB_llseek\fP(2)        1.2
157 \fB_newselect\fP(2)
158 \fB_sysctl\fP(2)
159 \fBaccept\fP(2)
160 \fBaccept4\fP(2)        2.6.28
161 \fBaccess\fP(2)
162 \fBacct\fP(2)
163 \fBadd_key\fP(2)        2.6.11
164 \fBadjtimex\fP(2)
165 \fBafs_syscall\fP(2)            Not implemented
166 \fBalarm\fP(2)
167 \fBalloc_hugepages\fP(2)        2.5.36  Removed in 2.5.44
168 \fBbdflush\fP(2)                Deprecated (does nothing)
169                 since 2.6
170 \fBbind\fP(2)
171 \fBbreak\fP(2)          Not implemented
172 \fBbrk\fP(2)
173 \fBcacheflush\fP(2)     1.2     Not on i386
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)
181 \fBclock_adjtime\fP(2)  2.6.39
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)
190 \fBcreate_module\fP(2)
191 \fBdelete_module\fP(2)
192 \fBdup\fP(2)
193 \fBdup2\fP(2)
194 \fBdup3\fP(2)   2.6.27
195 \fBepoll_create\fP(2)   2.6
196 \fBepoll_create1\fP(2)  2.6.27
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
201 \fBeventfd2\fP(2)       2.6.27
202 \fBexecve\fP(2)
203 \fBexit\fP(2)
204 \fBexit_group\fP(2)     2.6
205 \fBfaccessat\fP(2)      2.6.16
206 \fBfadvise64\fP(2)      2.6
207 .\" Implements \fBposix_fadvise\fP(2)
208 \fBfadvise64_64\fP(2)   2.6
209 \fBfallocate\fP(2)      2.6.23
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.
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
224 \fBflistxattr\fP(2)     2.6; 2.4.18
225 \fBflock\fP(2)  2.0
226 \fBfork\fP(2)
227 \fBfree_hugepages\fP(2) 2.5.36  Removed in 2.5.44
228 \fBfremovexattr\fP(2)   2.6; 2.4.18
229 \fBfsetxattr\fP(2)      2.6; 2.4.18
230 \fBfstat\fP(2)
231 \fBfstat64\fP(2)        2.4
232 \fBfstatat64\fP(2)      2.6.16
233 \fBfstatfs\fP(2)
234 \fBfstatfs64\fP(2)      2.6
235 \fBfsync\fP(2)
236 \fBftime\fP(2)          Not implemented
237 .\" Implemented in glibc; see \fBftime\fP(3)
238 \fBftruncate\fP(2)
239 \fBftruncate64\fP(2)    2.4
240 \fBfutex\fP(2)  2.6
241 \fBfutimesat\fP(2)      2.6.16
242 \fBget_kernel_syms\fP(2)
243 \fBget_mempolicy\fP(2)  2.6.6
244 \fBget_robust_list\fP(2)        2.6.17
245 \fBget_thread_area\fP(2)        2.6
246 \fBgetcpu\fP(2) 2.6.19
247 \fBgetcwd\fP(2) 2.2
248 \fBgetdents\fP(2)       2.0
249 \fBgetdents64\fP(2)     2.4
250 \fBgetegid\fP(2)
251 \fBgetegid32\fP(2)      2.4
252 \fBgeteuid\fP(2)
253 \fBgeteuid32\fP(2)      2.4
254 \fBgetgid\fP(2)
255 \fBgetgid32\fP(2)       2.4
256 \fBgetgroups\fP(2)
257 \fBgetgroups32\fP(2)    2.4
258 \fBgetitimer\fP(2)
259 \fBgetpeername\fP(2)
260 \fBgetpagesize\fP(2)    2.0     Not on i386
261 \fBgetpgid\fP(2)
262 \fBgetpgrp\fP(2)
263 \fBgetpid\fP(2)
264 \fBgetpmsg\fP(2)                Not implemented
265 .\" Reserved for STREAMS support
266 \fBgetppid\fP(2)
267 \fBgetpriority\fP(2)
268 \fBgetresgid\fP(2)      2.2
269 \fBgetresgid32\fP(2)    2.4
270 \fBgetresuid\fP(2)      2.2
271 \fBgetresuid32\fP(2)    2.4
272 \fBgetrlimit\fP(2)
273 \fBgetrusage\fP(2)
274 \fBgetsid\fP(2) 2.0
275 \fBgetsockname\fP(2)
276 \fBgetsockopt\fP(2)
277 \fBgettid\fP(2) 2.4.11
278 \fBgettimeofday\fP(2)
279 \fBgetuid\fP(2)
280 \fBgetuid32\fP(2)       2.4
281 .\" \fBgetunwind\fP(2)  2.4.8   ia64; DEPRECATED
282 \fBgetxattr\fP(2)       2.6; 2.4.18
283 \fBgtty\fP(2)           Not implemented
284 \fBidle\fP(2)           Not implemented
285 \fBinit_module\fP(2)
286 \fBinotify_add_watch\fP(2)      2.6.13
287 \fBinotify_init\fP(2)   2.6.13
288 \fBinotify_init1\fP(2)  2.6.27
289 \fBinotify_rm_watch\fP(2)       2.6.13
290 \fBio_cancel\fP(2)      2.6
291 \fBio_destroy\fP(2)     2.6
292 \fBio_getevents\fP(2)   2.6
293 \fBio_setup\fP(2)       2.6
294 \fBio_submit\fP(2)      2.6
295 \fBioctl\fP(2)
296 \fBioperm\fP(2)
297 \fBiopl\fP(2)
298 \fBioprio_get\fP(2)     2.6.13
299 \fBioprio_set\fP(2)     2.6.13
300 \fBipc\fP(2)
301 .\" Implements System V IPC calls
302 \fBkexec_load\fP(2)     2.6.13
303 .\" The entry in the syscall table was reserved starting in 2.6.7
304 .\" Was named sys_kexec_load() from 2.6.7 to 2.6.16
305 \fBkeyctl\fP(2) 2.6.11
306 \fBkill\fP(2)
307 \fBlchown\fP(2) 2.2
308 \fBlchown32\fP(2)       2.4
309 \fBlgetxattr\fP(2)      2.6; 2.4.18
310 \fBlink\fP(2)
311 \fBlinkat\fP(2) 2.6.16
312 \fBlisten\fP(2)
313 \fBlistxattr\fP(2)      2.6; 2.4.18
314 \fBllistxattr\fP(2)     2.6; 2.4.18
315 \fBlock\fP(2)           Not implemented
316 \fBlookup_dcookie\fP(2) 2.6
317 \fBlremovexattr\fP(2)   2.6; 2.4.18
318 \fBlseek\fP(2)
319 \fBlsetxattr\fP(2)      2.6; 2.4.18
320 \fBlstat\fP(2)
321 \fBlstat64\fP(2)        2.4
322 \fBmadvise\fP(2)        2.4
323 \fBmadvise1\fP(2)       2.4
324 \fBmbind\fP(2)  2.6.6
325 .\" \fBmemory_ordering\fP(2)    ???     Sparc64
326 \fBmigrate_pages\fP(2)  2.6.16
327 \fBmincore\fP(2)        2.4
328 \fBmkdir\fP(2)
329 \fBmkdirat\fP(2)        2.6.16
330 \fBmknod\fP(2)
331 \fBmknodat\fP(2)        2.6.16
332 \fBmlock\fP(2)
333 \fBmlockall\fP(2)
334 \fBmmap\fP(2)
335 \fBmmap2\fP(2)  2.4
336 \fBmodify_ldt\fP(2)
337 \fBmount\fP(2)
338 \fBmove_pages\fP(2)     2.6.18
339 \fBmprotect\fP(2)
340 \fBmpx\fP(2)            Not implemented
341 \fBmq_getsetattr\fP(2)  2.6.6
342 .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
343 \fBmq_notify\fP(2)      2.6.6
344 \fBmq_open\fP(2)        2.6.6
345 \fBmq_timedreceive\fP(2)        2.6.6
346 \fBmq_timedsend\fP(2)   2.6.6
347 \fBmq_unlink\fP(2)
348 \fBmremap\fP(2) 2.0
349 \fBmsgctl\fP(2)
350 \fBmsgget\fP(2)
351 \fBmsgrcv\fP(2)
352 \fBmsgsnd\fP(2)
353 \fBmsync\fP(2)  2.0
354 .\" \fBmultiplexer\fP(2)        ??      __NR_multiplexer reserved on
355 .\"             PowerPC, but unimplemented?
356 \fBmunlock\fP(2)
357 \fBmunlockall\fP(2)
358 \fBmunmap\fP(2)
359 \fBname_to_handle_at\fP(2)      2.6.39
360 \fBnanosleep\fP(2)      2.0
361 \fBnfsservctl\fP(2)     2.2     Removed in 3.1
362 \fBnice\fP(2)
363 \fBoldfstat\fP(2)
364 \fBoldlstat\fP(2)
365 \fBoldolduname\fP(2)
366 \fBoldstat\fP(2)
367 \fBolduname\fP(2)
368 \fBopen\fP(2)
369 \fBopen_by_handle_at\fP(2)      2.6.39
370 \fBopenat\fP(2) 2.6.16
371 \fBpause\fP(2)
372 \fBpciconfig_iobase\fP(2)       2.2.15; 2.4     Not on i386
373 .\" Alpha, PowerPC, ARM; not i386
374 \fBpciconfig_read\fP(2) 2.0.26; 2.2     Not on i386
375 .\" , PowerPC, ARM; not i386
376 \fBpciconfig_write\fP(2)        2.0.26; 2.2     Not on i386
377 .\" , PowerPC, ARM; not i386
378 \fBperf_event_open\fP(2)        2.6.31  Was called perf_counter_open()
379                 in 2.6.31; renamed in 2.6.32
380 \fBpersonality\fP(2)    1.2
381 .\" \fBperfctr\fP(2)    ???     Sparc32, Sparc64
382 .\" \fBperfmonctl\fP(2) ???     ia64
383 \fBphys\fP(2)           Not implemented
384 .\" Unimplemented (no slot since 2.1.116)
385 \fBpipe\fP(2)
386 \fBpipe2\fP(2)  2.6.27
387 \fBpivot_root\fP(2)     2.4
388 \fBpoll\fP(2)   2.2
389 \fBppoll\fP(2)  2.6.16
390 \fBprctl\fP(2)  2.2
391 \fBpread64\fP(2)                Added as "pread" in 2.2;
392                 renamed "pread64" in 2.6
393 \fBpreadv\fP(2) 2.6.30
394 \fBprlimit\fP(2)        2.6.36
395 \fBprof\fP(2)           Not implemented
396 \fBprofil\fP(2)         Not implemented
397 .\" Implemented in glibc; see \fBprofil\fP(3)
398 \fBpselect6\fP(2)       2.6.16
399 .\" Implements \fBpselect\fP(2)
400 \fBptrace\fP(2)
401 \fBputpmsg\fP(2)                Not implemented
402 .\" Reserved for STREAMS support
403 \fBpwrite64\fP(2)               Added as "pwrite" in 2.2;
404                 renamed "pwrite64" in 2.6
405 \fBpwritev\fP(2)        2.6.30
406 \fBquery_module\fP(2)   2.2
407 \fBquotactl\fP(2)
408 \fBread\fP(2)
409 \fBreadahead\fP(2)      2.4.13
410 \fBreaddir\fP(2)
411 .\" Supersedes \fBgetdents\fP(2)
412 \fBreadlink\fP(2)
413 \fBreadlinkat\fP(2)     2.6.16
414 \fBreadv\fP(2)  2.0
415 \fBreboot\fP(2)
416 \fBrecv\fP(2)
417 \fBrecvfrom\fP(2)
418 \fBrecvmsg\fP(2)
419 \fBrecvmmsg\fP(2)       2.6.33
420 \fBremap_file_pages\fP(2)       2.6
421 \fBremovexattr\fP(2)    2.6; 2.4.18
422 \fBrename\fP(2)
423 \fBrenameat\fP(2)       2.6.16
424 \fBrequest_key\fP(2)    2.6.11
425 \fBrestart_syscall\fP(2)        2.6
426 \fBrmdir\fP(2)
427 \fBrt_sigaction\fP(2)   2.2
428 \fBrt_sigpending\fP(2)  2.2
429 \fBrt_sigprocmask\fP(2) 2.2
430 \fBrt_sigqueueinfo\fP(2)        2.2
431 \fBrt_sigreturn\fP(2)   2.2
432 \fBrt_sigsuspend\fP(2)  2.2
433 \fBrt_sigtimedwait\fP(2)        2.2
434 \fBrt_tgsigqueueinfo\fP(2)      2.6.31
435 \fBsched_get_priority_max\fP(2) 2.0
436 \fBsched_get_priority_min\fP(2) 2.0
437 \fBsched_getaffinity\fP(2)      2.6
438 \fBsched_getparam\fP(2) 2.0
439 \fBsched_getscheduler\fP(2)     2.0
440 \fBsched_rr_get_interval\fP(2)  2.0
441 \fBsched_setaffinity\fP(2)      2.6
442 \fBsched_setparam\fP(2) 2.0
443 \fBsched_setscheduler\fP(2)     2.0
444 \fBsched_yield\fP(2)    2.0
445 \fBsecurity\fP(2)               Not implemented
446 \fBselect\fP(2)
447 \fBsemctl\fP(2)
448 \fBsemget\fP(2)
449 \fBsemop\fP(2)
450 \fBsemtimedop\fP(2)     2.6; 2.4.22
451 \fBsend\fP(2)
452 \fBsendfile\fP(2)       2.2
453 \fBsendfile64\fP(2)     2.6; 2.4.19
454 \fBsendmmsg\fP(2)       3.0
455 \fBsendmsg\fP(2)
456 \fBsendto\fP(2)
457 \fBset_mempolicy\fP(2)  2.6.6
458 \fBset_robust_list\fP(2)        2.6.17
459 \fBset_thread_area\fP(2)        2.6
460 \fBset_tid_address\fP(2)        2.6
461 \fBset_zone_reclaim\fP(2)       2.6.13  Removed in 2.6.16 (was never
462                 available to userspace)
463 .\" See http://lkml.org/lkml/2005/8/1/83
464 .\" "[PATCH] remove sys_set_zone_reclaim()"
465 \fBsetdomainname\fP(2)
466 \fBsetfsgid\fP(2)       1.2
467 \fBsetfsgid32\fP(2)     2.4
468 \fBsetfsuid\fP(2)       1.2
469 \fBsetfsuid32\fP(2)     2.4
470 \fBsetgid\fP(2)
471 \fBsetgid32\fP(2)       2.4
472 \fBsetgroups\fP(2)
473 \fBsetgroups32\fP(2)    2.4
474 \fBsethostname\fP(2)
475 \fBsetitimer\fP(2)
476 \fBsetns\fP(2)  3.0
477 \fBsetpgid\fP(2)
478 \fBsetpriority\fP(2)
479 \fBsetregid\fP(2)
480 \fBsetregid32\fP(2)     2.4
481 \fBsetresgid\fP(2)      2.2
482 \fBsetresgid32\fP(2)    2.4
483 \fBsetresuid\fP(2)      2.2
484 \fBsetresuid32\fP(2)    2.4
485 \fBsetreuid\fP(2)
486 \fBsetreuid32\fP(2)     2.4
487 \fBsetrlimit\fP(2)
488 \fBsetsid\fP(2)
489 \fBsetsockopt\fP(2)
490 \fBsettimeofday\fP(2)
491 \fBsetuid\fP(2)
492 \fBsetuid32\fP(2)       2.4
493 \fBsetup\fP(2)          Removed in 2.2
494 \fBsetxattr\fP(2)       2.6; 2.4.18
495 \fBsgetmask\fP(2)
496 \fBshmat\fP(2)
497 \fBshmctl\fP(2)
498 \fBshmdt\fP(2)
499 \fBshmget\fP(2)
500 \fBshutdown\fP(2)
501 \fBsigaction\fP(2)
502 \fBsigaltstack\fP(2)    2.2
503 \fBsignal\fP(2)
504 \fBsignalfd\fP(2)       2.6.22
505 \fBsignalfd4\fP(2)      2.6.27
506 \fBsigpending\fP(2)
507 \fBsigprocmask\fP(2)
508 \fBsigreturn\fP(2)
509 \fBsigsuspend\fP(2)
510 \fBsocket\fP(2)
511 \fBsocketcall\fP(2)
512 .\" Implements BSD socket calls
513 \fBsocketpair\fP(2)
514 \fBsplice\fP(2) 2.6.17
515 \fBspu_create\fP(2)     2.6.16  PowerPC only
516 \fBspu_run\fP(2)        2.6.16  PowerPC only
517 \fBssetmask\fP(2)
518 \fBstat\fP(2)
519 \fBstat64\fP(2) 2.4
520 \fBstatfs\fP(2)
521 \fBstatfs64\fP(2)       2.6
522 \fBstime\fP(2)
523 \fBstty\fP(2)           Not implemented
524 \fBsubpage_prot\fP(2)   2.6.25  PowerPC if CONFIG_PPC_64K_PAGES
525 \fBswapoff\fP(2)
526 \fBswapon\fP(2)
527 \fBsymlink\fP(2)
528 \fBsymlinkat\fP(2)      2.6.16
529 \fBsync\fP(2)
530 \fBsync_file_range\fP(2)        2.6.17
531 \fBsync_file_range2\fP(2)       2.6.22  Architecture-specific variant
532 .\" PowerPC, ARM, tile
533 .\" First appeared on ARM, as arm_sync_file_range(), but later renamed
534                 of \fBsync_file_range\fP(2)
535 .\" \fBsys_debug_setcontext\fP(2)       ???     PowerPC if CONFIG_PPC32
536 \fBsyncfs\fP(2) 2.6.39
537 \fBsysfs\fP(2)  1.2
538 \fBsysinfo\fP(2)
539 \fBsyslog\fP(2)
540 .\" glibc interface is \fBklogctl\fP(3)
541 \fBtee\fP(2)    2.6.17
542 \fBtgkill\fP(2) 2.6
543 \fBtime\fP(2)
544 \fBtimer_create\fP(2)   2.6
545 \fBtimer_delete\fP(2)   2.6
546 \fBtimer_getoverrun\fP(2)       2.6
547 \fBtimer_gettime\fP(2)  2.6
548 \fBtimer_settime\fP(2)  2.6
549 \fBtimerfd_create\fP(2) 2.6.25
550 \fBtimerfd_gettime\fP(2)        2.6.25
551 \fBtimerfd_settime\fP(2)        2.6.25
552 \fBtimes\fP(2)
553 \fBtkill\fP(2)  2.6; 2.4.22
554 \fBtruncate\fP(2)
555 \fBtruncate64\fP(2)     2.4
556 \fBtuxcall\fP(2)                Not implemented
557 .\" Unimplemented; no slot on i386
558 .\" As at 2.6.22, tuxcall has a slot on PowerPC, x86_64, and alpha
559 \fBugetrlimit\fP(2)     2.4
560 \fBulimit\fP(2)         Not implemented
561 .\" Implemented in glibc; see \fBulimit\fP(3)
562 \fBumask\fP(2)
563 \fBumount\fP(2)
564 .\" sys_oldumount() -- __NR_umount
565 \fBumount2\fP(2)        2.2
566 .\" sys_umount() -- __NR_umount2
567 \fBuname\fP(2)
568 \fBunlink\fP(2)
569 \fBunlinkat\fP(2)       2.6.16
570 \fBunshare\fP(2)        2.6.16
571 \fBuselib\fP(2)
572 \fBustat\fP(2)
573 \fButime\fP(2)
574 \fButimensat\fP(2)      2.6.22
575 \fButimes\fP(2) 2.2
576 \fBvfork\fP(2)
577 \fBvhangup\fP(2)
578 \fBvm86old\fP(2)
579 .\" Superseded by \fBvm86\fP(2)
580 \fBvmsplice\fP(2)       2.6.17
581 \fBvserver\fP(2)                Not implemented
582 \fBwait4\fP(2)
583 \fBwaitid\fP(2) 2.6.10
584 \fBwaitpid\fP(2)
585 \fBwrite\fP(2)
586 \fBwritev\fP(2) 2.0
587 .TE
588 .PP
589 On many platforms, including i386, socket calls are all multiplexed
590 (via glibc wrapper functions) through
591 .BR socketcall (2)
592 and similarly System V IPC calls are multiplexed through
593 .BR ipc (2).
594 .SH NOTES
595 Note the following points:
596 .IP * 3
597 Although slots are reserved for them in the system call table,
598 the following system calls are not implemented in the standard kernel:
599 .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
600 .BR break (2),       \" __NR_break is 17 on Linux 2.6.22/i386
601 .BR ftime (2),       \" __NR_ftime is 35 on Linux 2.6.22/i386
602 .BR getpmsg (2),     \" __NR_getpmsg is 188 on Linux 2.6.22/i386
603 .BR gtty (2),        \" __NR_gtty is 32 on Linux 2.6.22/i386
604 .BR idle (2),        \" __NR_idle is 112 on Linux 2.6.22/i386
605 .BR lock (2),        \" __NR_lock is 53 on Linux 2.6.22/i386
606 .BR madvise1 (2),    \" __NR_madvise1 is 219 on Linux 2.6.22/i386
607 .BR mpx (2),         \" __NR_mpx is 66 on Linux 2.6.22/i386
608 .BR phys (2),        \" Slot has been reused
609 .BR prof (2),        \" __NR_prof is 44 on Linux 2.6.22/i386
610 .BR profil (2),      \" __NR_profil is 98 on Linux 2.6.22/i386
611 .BR putpmsg (2),     \" __NR_putpmsg is 189 on Linux 2.6.22/i386
612 .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
613 .\" on a couple of 2.6 architectures
614 .BR security (2),    \" __NR_security is 223 on Linux 2.4/i386
615 .BR stty (2),        \" __NR_stty is 31 on Linux 2.6.22/i386
616 .BR tuxcall (2),     \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
617 .BR ulimit (2),      \" __NR_ulimit is 58 on Linux 2.6.22/i386
618 and
619 .BR vserver (2)      \" __NR_vserver is 273 on Linux 2.6.22/i386
620 (see also
621 .BR unimplemented (2)).
622 However,
623 .BR ftime (3),
624 .BR profil (3)
625 and
626 .BR ulimit (3)
627 exist as library routines.
628 The slot for
629 .BR phys (2)
630 is in use since kernel 2.1.116 for
631 .BR umount (2);
632 .BR phys (2)
633 will never be implemented.
634 .IP *
635 The
636 .BR getpmsg (2)
637 and
638 .BR putpmsg (2)
639 calls are for kernels patched to support STREAMS,
640 and may never be in the standard kernel.
641 .\" The security call is for future use.
642 .PP
643 Roughly speaking, the code belonging to the system call
644 with number __NR_xxx defined in
645 .I /usr/include/asm/unistd.h
646 can be found in the kernel source in the routine
647 .IR sys_xxx ().
648 (The dispatch table for i386 can be found in
649 .IR /usr/src/linux/arch/i386/kernel/entry.S .)
650 There are many exceptions, however, mostly because
651 older system calls were superseded by newer ones,
652 and this has been treated somewhat unsystematically.
653 On platforms with
654 proprietary OS emulation, such as parisc, sparc, sparc64 and alpha,
655 there are many additional system calls; mips64 also contains a full
656 set of 32-bit system calls.
657
658 Over time, changes to the interfaces of some system calls have been
659 necessary.
660 One reason for such changes was the need to increase the size of
661 structures or scalar values passed to the system call.
662 Because of these changes, there are now various groups
663 of related system calls
664 (e.g.,
665 .BR truncate (2)
666 and
667 .BR truncate64 (2))
668 which perform similar tasks, but which vary in
669 details such as the size of their arguments.
670 (As noted earlier, applications are generally unaware of this:
671 the glibc wrapper functions do some work to ensure that the right
672 system call is invoked, and that ABI compatibility is
673 preserved for old binaries.)
674 Examples of systems calls that exist in multiple versions are
675 the following:
676 .IP * 3
677 By now there are three different versions of
678 .BR stat (2):
679 .IR sys_stat ()
680 (slot
681 .IR __NR_oldstat ),
682 .IR sys_newstat ()
683 (slot
684 .IR __NR_stat ),
685 and
686 .IR sys_stat64 ()
687 (slot
688 .IR __NR_stat64 ),
689 with the last being the most current.
690 .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
691 .\" The stat system calls deal with three different data structures,
692 .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
693 A similar story applies for
694 .BR lstat (2)
695 and
696 .BR fstat (2).
697 .IP *
698 Similarly, the defines
699 .IR __NR_oldolduname ,
700 .IR __NR_olduname ,
701 and
702 .I __NR_uname
703 refer to the routines
704 .IR sys_olduname (),
705 .IR sys_uname ()
706 and
707 .IR sys_newuname ().
708 .IP *
709 In Linux 2.0, a new version of
710 .BR vm86 (2)
711 appeared, with the old and the new kernel routines being named
712 .IR sys_vm86old ()
713 and
714 .IR sys_vm86 ().
715 .IP *
716 In Linux 2.4, a new version of
717 .BR getrlimit (2)
718 appeared, with the old and the new kernel routines being named
719 .IR sys_old_getrlimit ()
720 (slot
721 .IR __NR_getrlimit )
722 and
723 .IR sys_getrlimit ()
724 (slot
725 .IR __NR_ugetrlimit ).
726 .IP *
727 Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
728 .\" 64-bit off_t changes: ftruncate64, *stat64,
729 .\" fcntl64 (because of the flock structure), getdents64, *statfs64
730 To support this change, a range of system calls were added
731 (e.g.,
732 .BR chown32 (2),
733 .BR getuid32 (2),
734 .BR getgroups32 (2),
735 .BR setresuid32 (2)),
736 superseding earlier calls of the same name without the
737 "32" suffix.
738 .IP *
739 Linux 2.4 added support for applications on 32-bit architectures
740 to access large files (i.e., files for which the sizes and
741 file offsets can't be represented in 32 bits.)
742 To support this change, replacements were required for system calls
743 that deal with file offsets and sizes.
744 Thus the following system calls were added:
745 .BR fcntl64 (2),
746 .BR ftruncate64 (2),
747 .BR getdents64 (2),
748 .BR stat64 (2),
749 .BR statfs64 (2),
750 and their analogs that work with file descriptors or
751 symbolic links.
752 These system calls supersede the older system calls
753 which, except in the case of the "stat" calls,
754 have the same name without the "64" suffix.
755
756 On newer platforms that only have 64-bit file access and 32-bit uids
757 (e.g., alpha, ia64, s390x) there are no *64 or *32 calls.
758 Where the *64 and *32 calls exist, the other versions are obsolete.
759 .IP *
760 The
761 .I rt_sig*
762 calls were added in kernel 2.2 to support the addition
763 of real-time signals (see
764 .BR signal (7)).
765 These system calls supersede the older system calls of the same
766 name without the "rt_" prefix.
767 .IP *
768 The
769 .BR select (2)
770 and
771 .BR mmap (2)
772 system calls use five or more arguments,
773 which caused problems the way
774 argument passing on the i386 used to be set up.
775 Thus, while other architectures have
776 .IR sys_select ()
777 and
778 .IR sys_mmap ()
779 corresponding to
780 .I __NR_select
781 and
782 .IR __NR_mmap ,
783 on i386 one finds
784 .IR old_select ()
785 and
786 .IR old_mmap ()
787 (routines that use a pointer to a
788 argument block) instead.
789 These days passing five arguments
790 is not a problem any more, and there is a
791 .I __NR__newselect
792 .\" (used by libc 6)
793 that corresponds directly to
794 .IR sys_select ()
795 and similarly
796 .IR __NR_mmap2 .
797 .\" .PP
798 .\" Two system call numbers,
799 .\" .IR __NR__llseek
800 .\" and
801 .\" .IR __NR__sysctl
802 .\" have an additional underscore absent in
803 .\" .IR sys_llseek ()
804 .\" and
805 .\" .IR sys_sysctl ().
806 .\"
807 .\" In kernel 2.1.81,
808 .\" .BR lchown (2)
809 .\" and
810 .\" .BR chown (2)
811 .\" were swapped; that is,
812 .\" .BR lchown (2)
813 .\" was added with the semantics that were then current for
814 .\" .BR chown (2),
815 .\" and the semantics of the latter call were changed to what
816 .\" they are today.
817 .SH SEE ALSO
818 .BR syscall (2),
819 .BR unimplemented (2),
820 .BR libc (7)