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