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