OSDN Git Service

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