OSDN Git Service

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