1 .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" with some input from Stepan Kasal <kasal@ucw.cz>
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>
9 .\" %%%LICENSE_START(VERBATIM)
10 .\" Permission is granted to make and distribute verbatim copies of this
11 .\" manual provided the copyright notice and this permission notice are
12 .\" preserved on all copies.
14 .\" Permission is granted to copy and distribute modified versions of this
15 .\" manual under the conditions for verbatim copying, provided that the
16 .\" entire resulting derived work is distributed under the terms of a
17 .\" permission notice identical to this one.
19 .\" Since the Linux kernel and libraries are constantly changing, this
20 .\" manual page may be incorrect or out-of-date. The author(s) assume no
21 .\" responsibility for errors or omissions, or for damages resulting from
22 .\" the use of the information contained herein. The author(s) may not
23 .\" have taken the same level of care in the production of this manual,
24 .\" which is licensed free of charge, as they might when working
27 .\" Formatted or processed versions of this manual, if unaccompanied by
28 .\" the source, must acknowledge the copyright and authors of this work.
31 .TH SYSCALLS 2 2018-02-02 "Linux" "Linux Programmer's Manual"
33 syscalls \- Linux system calls
37 The system call is the fundamental interface between an application
39 .SS System calls and library wrapper functions
40 System calls are generally not invoked directly,
41 but rather via wrapper functions in glibc (or perhaps some other library).
42 For details of direct invocation of a system call, see
44 Often, but not always, the name of the wrapper function is the same
45 as the name of the system call that it invokes.
46 For example, glibc contains a function
48 which invokes the underlying "chdir" system call.
50 Often the glibc wrapper function is quite thin, doing little work
51 other than copying arguments to the right registers
52 before invoking the system call,
55 appropriately after the system call has returned.
56 (These are the same steps that are performed by
58 which can be used to invoke system calls
59 for which no wrapper function is provided.)
60 Note: system calls indicate a failure by returning a negative error
61 number to the caller on architectures without a separate error register/flag,
65 the wrapper function negates the returned error number
66 (to make it positive), copies it to
68 and returns \-1 to the caller of the wrapper.
70 Sometimes, however, the wrapper function does some extra work
71 before invoking the system call.
72 For example, nowadays there are (for reasons described below) two
79 wrapper function checks which of those system calls
80 are provided by the kernel and determines which should be employed.
82 Below is a list of the Linux system calls.
85 column indicates the kernel version
86 for those system calls that were new in Linux 2.2,
87 or have appeared since that kernel version.
88 Note the following points:
90 Where no kernel version is indicated,
91 the system call appeared in kernel 1.0 or earlier.
93 Where a system call is marked "1.2"
94 this means the system call probably appeared in a 1.1.x kernel version,
95 and first appeared in a stable kernel with 1.2.
96 (Development of the 1.2 kernel was initiated from a branch of kernel
97 1.0.6 via the 1.1.x unstable kernel series.)
99 Where a system call is marked "2.0"
100 this means the system call probably appeared in a 1.3.x kernel version,
101 and first appeared in a stable kernel with 2.0.
102 (Development of the 2.0 kernel was initiated from a branch of kernel
103 1.2.x, somewhere around 1.2.10,
104 via the 1.3.x unstable kernel series.)
105 .\" Was kernel 2.0 started from a branch of 1.2.10?
106 .\" At least from the timestamps of the tarballs of
107 .\" of 1.2.10 and 1.3.0, that's how it looks, but in
108 .\" fact the diff doesn't seem very clear, the
109 .\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the
110 .\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the
111 .\" timestamps of some files in 1.3.0 seem to be older
112 .\" than those in 1.2.10. All of this suggests
113 .\" that there might not have been a clean branch point.
115 Where a system call is marked "2.2"
116 this means the system call probably appeared in a 2.1.x kernel version,
117 and first appeared in a stable kernel with 2.2.0.
118 (Development of the 2.2 kernel was initiated from a branch of kernel
119 2.0.21 via the 2.1.x unstable kernel series.)
121 Where a system call is marked "2.4"
122 this means the system call probably appeared in a 2.3.x kernel version,
123 and first appeared in a stable kernel with 2.4.0.
124 (Development of the 2.4 kernel was initiated from a branch of
125 kernel 2.2.8 via the 2.3.x unstable kernel series.)
127 Where a system call is marked "2.6"
128 this means the system call probably appeared in a 2.5.x kernel version,
129 and first appeared in a stable kernel with 2.6.0.
130 (Development of kernel 2.6 was initiated from a branch
131 of kernel 2.4.15 via the 2.5.x unstable kernel series.)
133 Starting with kernel 2.6.0, the development model changed,
134 and new system calls may appear in each 2.6.x release.
135 In this case, the exact version number where the system call appeared
137 This convention continues with the 3.x kernel series,
138 which followed on from kernel 2.6.39, and the 4.x kernel series,
139 which followed on from kernel 3.19.
141 In some cases, a system call was added to a stable kernel
142 series after it branched from the previous stable kernel
143 series, and then backported into the earlier stable kernel series.
144 For example some system calls that appeared in 2.6.x were also backported
145 into a 2.4.x release after 2.4.15.
146 When this is so, the version where the system call appeared
147 in both of the major kernel series is listed.
149 The list of system calls that are available as at kernel 4.19
150 (or in a few cases only on older kernels) is as follows:
152 .\" Looking at scripts/checksyscalls.sh in the kernel source is
153 .\" instructive about x86 specifics.
160 \fBSystem call\fP \fBKernel\fP \fBNotes\fP
163 \fB_newselect\fP(2) 2.0
165 \fBaccept\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
166 \fBaccept4\fP(2) 2.6.28
169 \fBadd_key\fP(2) 2.6.10
170 \fBadjtimex\fP(2) 1.0
172 \fBalloc_hugepages\fP(2) 2.5.36 Removed in 2.5.44
173 .\" 4adeefe161a74369e44cc8e663f240ece0470dc3
174 \fBarc_gettls\fP(2) 3.9 ARC only
175 \fBarc_settls\fP(2) 3.9 ARC only
176 .\" 91e040a79df73d371f70792f30380d4e44805250
177 \fBarc_usr_cmpxchg\fP(2) 4.9 ARC onlt
178 .\" x86: 79170fda313ed5be2394f87aa2a00d597f8ed4a1
179 \fBarch_prctl\fP(2) 2.6 x86_64, x86 since 4.12
180 .\" 9674cdc74d63f346870943ef966a034f8c71ee57
181 \fBatomic_barrier\fP(2) 2.6.34 m68k only
182 \fBatomic_cmpxchg_32\fP(2) 2.6.34 m68k only
183 \fBbdflush\fP(2) 1.2 T{
184 Deprecated (does nothing)
188 \fBbfin_spinlock\fP(2) 2.6.22 T{
189 Blackfin only (port removed
193 \fBbind\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
196 \fBbreakpoint\fP(2) 2.2 T{
197 ARM OABI only, defined with
199 \fB__ARM_NR\fP prefix
201 \fBcacheflush\fP(2) 1.2 Not on x86
206 \fBchown\fP(2) 2.2 T{
207 See \fBchown\fP(2) for
213 \fBclock_adjtime\fP(2) 2.6.39
214 \fBclock_getres\fP(2) 2.6
215 \fBclock_gettime\fP(2) 2.6
216 \fBclock_nanosleep\fP(2) 2.6
217 \fBclock_settime\fP(2) 2.6
218 \fBclone2\fP(2) 2.4 IA-64 only
221 .\" .\" dcef1f634657dabe7905af3ccda12cf7f0b6fcc1
222 .\" .\" cc20d42986d5807cbe4f5c7c8e3dab2e59ea0db3
223 .\" .\" db695c0509d6ec9046ee5e4c520a19fa17d9fce2
224 .\" \fBcmpxchg\fP(2) 2.6.12 T{
225 .\" ARM, syscall constant never was
227 .\" exposed to userspace, in-kernel
229 .\" definition had \fB__ARM_NR\fP prefix,
233 .\" 867e359b97c970a60626d5d76bbe2a8fadbf38fb
234 .\" bb9d812643d8a121df7d614a2b9c60193a92deb0
235 \fBcmpxchg_badaddr\fP(2) 2.6.36 T{
236 Tile only (port removed
240 \fBconnect\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
241 \fBcopy_file_range\fP(2) 4.5
243 \fBcreate_module\fP(2) 1.0 Removed in 2.6
244 \fBdelete_module\fP(2) 1.0
245 .\" 1394f03221790a988afc3e4b3cb79f2e477246a9
246 .\" 4ba66a9760722ccbb691b8f7116cad2f791cca7b
247 \fBdma_memcpy\fP(2) 2.6.22 T{
248 Blackfin only (port removed
255 \fBepoll_create\fP(2) 2.6
256 \fBepoll_create1\fP(2) 2.6.27
257 \fBepoll_ctl\fP(2) 2.6
258 \fBepoll_pwait\fP(2) 2.6.19
259 \fBepoll_wait\fP(2) 2.6
260 \fBeventfd\fP(2) 2.6.22
261 \fBeventfd2\fP(2) 2.6.27
262 \fBexecv\fP(2) 2.0 T{
263 SPARC/SPARC64 only, for
265 compatability with SunOS
268 \fBexecveat\fP(2) 3.19
270 \fBexit_group\fP(2) 2.6
271 \fBfaccessat\fP(2) 2.6.16
272 \fBfadvise64\fP(2) 2.6
273 .\" Implements \fBposix_fadvise\fP(2)
274 \fBfadvise64_64\fP(2) 2.6
275 \fBfallocate\fP(2) 2.6.23
276 \fBfanotify_init\fP(2) 2.6.37
277 \fBfanotify_mark\fP(2) 2.6.37
278 .\" The fanotify calls were added in Linux 2.6.36,
279 .\" but disabled while the API was finalized.
282 \fBfchmodat\fP(2) 2.6.16
284 \fBfchown32\fP(2) 2.4
285 \fBfchownat\fP(2) 2.6.16
288 \fBfdatasync\fP(2) 2.0
289 \fBfgetxattr\fP(2) 2.6; 2.4.18
290 \fBfinit_module\fP(2) 3.8
291 \fBflistxattr\fP(2) 2.6; 2.4.18
294 \fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44
295 \fBfremovexattr\fP(2) 2.6; 2.4.18
296 \fBfsetxattr\fP(2) 2.6; 2.4.18
299 \fBfstatat64\fP(2) 2.6.16
301 \fBfstatfs64\fP(2) 2.6
303 \fBftruncate\fP(2) 1.0
304 \fBftruncate64\fP(2) 2.4
306 \fBfutimesat\fP(2) 2.6.16
307 \fBget_kernel_syms\fP(2) 1.0 Removed in 2.6
308 \fBget_mempolicy\fP(2) 2.6.6
309 \fBget_robust_list\fP(2) 2.6.17
310 \fBget_thread_area\fP(2) 2.6
311 .\" 8fcd6c45f5a65621ec809b7866a3623e9a01d4ed
312 \fBget_tls\fP(2) 4.15 T{
315 \fB__ARM_NR\fP prefix
317 \fBgetcpu\fP(2) 2.6.19
319 \fBgetdents\fP(2) 2.0
320 \fBgetdents64\fP(2) 2.4
321 .\" parisc: 863722e856e64dae0e252b6bb546737c6c5626ce
322 \fBgetdomainname\fP(2) 2.2 T{
323 SPARC, SPARC64; available
325 as \fBosf_getdomainname\fP(2)
327 on Alpha since Linux 2.0
329 .\" ec98c6b9b47df6df1c1fa6cf3d427414f8c2cf16
330 \fBgetdtablesize\fP(2) 2.0 T{
331 SPARC (removed in 2.6.26),
333 available since Linux 2.0 on Alpha as
334 \fBosf_getdtablesize\fP(2)
337 \fBgetegid32\fP(2) 2.4
339 \fBgeteuid32\fP(2) 2.4
341 \fBgetgid32\fP(2) 2.4
342 \fBgetgroups\fP(2) 1.0
343 \fBgetgroups32\fP(2) 2.4
344 .\" SPARC removal: ec98c6b9b47df6df1c1fa6cf3d427414f8c2cf16
345 \fBgethostname\fP(2) 2.0 T{
346 Alpha, was available on
348 SPARC up to Linux 2.6.26
350 \fBgetitimer\fP(2) 1.0
351 \fBgetpeername\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
352 \fBgetpagesize\fP(2) 2.0 Not on x86
357 \fBgetpriority\fP(2) 1.0
358 \fBgetrandom\fP(2) 3.17
359 \fBgetresgid\fP(2) 2.2
360 \fBgetresgid32\fP(2) 2.4
361 \fBgetresuid\fP(2) 2.2
362 \fBgetresuid32\fP(2) 2.4
363 \fBgetrlimit\fP(2) 1.0
364 \fBgetrusage\fP(2) 1.0
366 \fBgetsockname\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
367 \fBgetsockopt\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
368 \fBgettid\fP(2) 2.4.11
369 \fBgettimeofday\fP(2) 1.0
371 \fBgetuid32\fP(2) 2.4
372 \fBgetunwind\fP(2) 2.4.8 IA-64 only; deprecated
373 \fBgetxattr\fP(2) 2.6; 2.4.18
374 \fBgetxgid\fP(2) 2.0 Alpha only; see NOTES
375 \fBgetxpid\fP(2) 2.0 Alpha only; see NOTES
376 \fBgetxuid\fP(2) 2.0 Alpha only; see NOTES
377 \fBinit_module\fP(2) 1.0
378 \fBinotify_add_watch\fP(2) 2.6.13
379 \fBinotify_init\fP(2) 2.6.13
380 \fBinotify_init1\fP(2) 2.6.27
381 \fBinotify_rm_watch\fP(2) 2.6.13
382 \fBio_cancel\fP(2) 2.6
383 \fBio_destroy\fP(2) 2.6
384 \fBio_getevents\fP(2) 2.6
385 \fBio_pgetevents\fP(2) 4.18
386 \fBio_setup\fP(2) 2.6
387 \fBio_submit\fP(2) 2.6
391 \fBioprio_get\fP(2) 2.6.13
392 \fBioprio_set\fP(2) 2.6.13
394 .\" Implements System V IPC calls
396 \fBkern_features\fP(2) 3.7 SPARC64 only
397 .\" FIXME . document kern_features():
398 .\" commit 517ffce4e1a03aea979fe3a18a3dd1761a24fafb
399 \fBkexec_file_load\fP(2) 3.17
400 \fBkexec_load\fP(2) 2.6.13
401 .\" The entry in the syscall table was reserved starting in 2.6.7
402 .\" Was named sys_kexec_load() from 2.6.7 to 2.6.16
403 \fBkeyctl\fP(2) 2.6.10
405 \fBlchown\fP(2) 1.0 T{
406 See \fBchown\fP(2) for
410 \fBlchown32\fP(2) 2.4
411 \fBlgetxattr\fP(2) 2.6; 2.4.18
413 \fBlinkat\fP(2) 2.6.16
414 \fBlisten\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
415 \fBlistxattr\fP(2) 2.6; 2.4.18
416 \fBllistxattr\fP(2) 2.6; 2.4.18
417 \fBlookup_dcookie\fP(2) 2.6
418 \fBlremovexattr\fP(2) 2.6; 2.4.18
420 \fBlsetxattr\fP(2) 2.6; 2.4.18
425 \fBmemory_ordering\fP(2) 2.2 SPARC64 only
426 .\" 26025bbfbba33a9425be1b89eccb4664ea4c17b6
427 .\" bb6fb6dfcc17cddac11ac295861f7608194447a7
428 \fBmetag_get_tls\fP(2) 3.9 T{
429 Metag only (port removed
433 \fBmetag_set_fpu_flags\fP(2) 3.9 T{
434 Metag only (port removed
438 \fBmetag_set_tls\fP(2) 3.9 T{
439 Metag only (port removed
443 \fBmetag_setglobalbit\fP(2) 3.9 T{
444 Metag only (port removed
448 \fBmembarrier\fP(2) 3.17
449 \fBmemfd_create\fP(2) 3.17
450 \fBmigrate_pages\fP(2) 2.6.16
453 \fBmkdirat\fP(2) 2.6.16
455 \fBmknodat\fP(2) 2.6.16
458 \fBmlockall\fP(2) 2.0
461 \fBmodify_ldt\fP(2) 1.0
463 \fBmove_pages\fP(2) 2.6.18
464 \fBmprotect\fP(2) 1.0
465 \fBmq_getsetattr\fP(2) 2.6.6
466 .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
467 \fBmq_notify\fP(2) 2.6.6
468 \fBmq_open\fP(2) 2.6.6
469 \fBmq_timedreceive\fP(2) 2.6.6
470 \fBmq_timedsend\fP(2) 2.6.6
471 \fBmq_unlink\fP(2) 2.6.6
473 \fBmsgctl\fP(2) 2.0 See notes on \fBipc\fP(2)
474 \fBmsgget\fP(2) 2.0 See notes on \fBipc\fP(2)
475 \fBmsgrcv\fP(2) 2.0 See notes on \fBipc\fP(2)
476 \fBmsgsnd\fP(2) 2.0 See notes on \fBipc\fP(2)
478 .\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on
479 .\" PowerPC, but unimplemented?
481 \fBmunlockall\fP(2) 2.0
483 \fBname_to_handle_at\fP(2) 2.6.39
484 \fBnanosleep\fP(2) 2.0
485 .\" 5590ff0d5528b60153c0b4e7b771472b5a95e297
486 \fBnewfstatat\fP(2) 2.6.16 See \fBstat\fP(2)
487 \fBnfsservctl\fP(2) 2.2 Removed in 3.1
489 \fBold_adjtimex\fP(2) 2.0 ALPA only; see NOTES
490 \fBold_getrlimit\fP(2) 2.4 T{
491 Old variant of \fBgetrlimit\fP(2)
493 that used a different value
495 for \fBRLIM_INFINITY\fP
497 \fBoldfstat\fP(2) 1.0
498 \fBoldlstat\fP(2) 1.0
499 \fBoldolduname\fP(2) 1.0
501 \fBoldumount\fP(2) 2.4.116 T{
502 Name of the old \fBumount\fP(2)
506 \fBolduname\fP(2) 1.0
508 \fBopen_by_handle_at\fP(2) 2.6.39
509 \fBopenat\fP(2) 2.6.16
510 .\" 9d02a4283e9ce4e9ca11ff00615bdacdb0515a1a
511 \fBor1k_atomic\fP(2) 3.1 OpenRISC 1000 only
513 \fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on x86
514 .\" Alpha, PowerPC, ARM; not x86
515 \fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on x86
516 .\" , PowerPC, ARM; not x86
517 \fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on x86
518 .\" , PowerPC, ARM; not x86
519 \fBperf_event_open\fP(2) 2.6.31 T{
520 Was perf_counter_open() in
522 2.6.31; renamed in 2.6.32
524 \fBpersonality\fP(2) 1.2
525 \fBperfctr\fP(2) 2.2 SPARC only; removed in 2.6.34
526 .\" commit c7d5a0050773e98d1094eaa9f2a1a793fafac300 removed perfctr()
527 \fBperfmonctl\fP(2) 2.4 IA-64 only
529 \fBpipe2\fP(2) 2.6.27
530 \fBpivot_root\fP(2) 2.4
531 \fBpkey_alloc\fP(2) 4.8
532 \fBpkey_free\fP(2) 4.8
533 \fBpkey_mprotect\fP(2) 4.8
534 \fBpoll\fP(2) 2.0.36; 2.2
535 \fBppoll\fP(2) 2.6.16
538 Used for \fBpread64\fP(2) on AVR32
540 (port removed in Linux 4.12)
542 and Blackfin (port removed
547 Added as "pread" in 2.2;
549 renamed "pread64" in 2.6
551 \fBpreadv\fP(2) 2.6.30
553 \fBprlimit64\fP(2) 2.6.36
554 \fBprocess_vm_readv\fP(2) 3.2
555 \fBprocess_vm_writev\fP(2) 3.2
556 \fBpselect6\fP(2) 2.6.16
557 .\" Implements \fBpselect\fP(2)
560 Used for \fBpwrite64\fP(2) on AVR32
561 (port removed in Linux 4.12)
562 and Blackfin (port removed
566 Added as "pwrite" in 2.2;
568 renamed "pwrite64" in 2.6
570 \fBpwritev\fP(2) 2.6.30
571 \fBpwritev2\fP(2) 4.6
572 \fBquery_module\fP(2) 2.2 Removed in 2.6
573 \fBquotactl\fP(2) 1.0
575 \fBreadahead\fP(2) 2.4.13
577 .\" Supersedes \fBgetdents\fP(2)
578 \fBreadlink\fP(2) 1.0
579 \fBreadlinkat\fP(2) 2.6.16
582 \fBrecv\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
583 \fBrecvfrom\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
584 \fBrecvmsg\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
585 \fBrecvmmsg\fP(2) 2.6.33
586 \fBremap_file_pages\fP(2) 2.6 Deprecated since 3.16
587 \fBremovexattr\fP(2) 2.6; 2.4.18
589 \fBrenameat\fP(2) 2.6.16
590 \fBrenameat2\fP(2) 3.15
591 \fBrequest_key\fP(2) 2.6.10
592 \fBrestart_syscall\fP(2) 2.6
593 .\" 921ebd8f2c081b3cf6c3b29ef4103eef3ff26054
594 \fBriscv_flush_icache\fP(2) 4.15 RISC-V only
597 \fBrt_sigaction\fP(2) 2.2
598 \fBrt_sigpending\fP(2) 2.2
599 \fBrt_sigprocmask\fP(2) 2.2
600 \fBrt_sigqueueinfo\fP(2) 2.2
601 \fBrt_sigreturn\fP(2) 2.2
602 \fBrt_sigsuspend\fP(2) 2.2
603 \fBrt_sigtimedwait\fP(2) 2.2
604 \fBrt_tgsigqueueinfo\fP(2) 2.6.31
605 \fBrtas\fP(2) 2.6.2 PowerPC/PowerPC64 only
606 \fBs390_runtime_instr\fP(2) 3.7 s390 only
607 \fBs390_pci_mmio_read\fP(2) 3.19 s390 only
608 \fBs390_pci_mmio_write\fP(2) 3.19 s390 only
609 \fBs390_sthyi\fP(2) 4.15 s390 only
610 \fBs390_guarded_storage\fP(2) 4.12 s390 only
611 \fBsched_get_affinity\fP(2) 2.6 T{
612 Name of \fBsched_getaffinity\fP(2)
616 \fBsched_get_priority_max\fP(2) 2.0
617 \fBsched_get_priority_min\fP(2) 2.0
618 \fBsched_getaffinity\fP(2) 2.6
619 \fBsched_getattr\fP(2) 3.14
620 \fBsched_getparam\fP(2) 2.0
621 \fBsched_getscheduler\fP(2) 2.0
622 \fBsched_rr_get_interval\fP(2) 2.0
623 \fBsched_set_affinity\fP(2) 2.6 T{
624 Name of \fBsched_setaffinity\fP(2)
628 \fBsched_setaffinity\fP(2) 2.6
629 \fBsched_setattr\fP(2) 3.14
630 \fBsched_setparam\fP(2) 2.0
631 \fBsched_setscheduler\fP(2) 2.0
632 \fBsched_yield\fP(2) 2.0
633 \fBseccomp\fP(2) 3.17
635 \fBsemctl\fP(2) 2.0 See notes on \fBipc\fP(2)
636 \fBsemget\fP(2) 2.0 See notes on \fBipc\fP(2)
637 \fBsemop\fP(2) 2.0 See notes on \fBipc\fP(2)
638 \fBsemtimedop\fP(2) 2.6; 2.4.22
639 \fBsend\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
640 \fBsendfile\fP(2) 2.2
641 \fBsendfile64\fP(2) 2.6; 2.4.19
642 \fBsendmmsg\fP(2) 3.0
643 \fBsendmsg\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
644 \fBsendto\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
645 \fBset_mempolicy\fP(2) 2.6.6
646 \fBset_robust_list\fP(2) 2.6.17
647 \fBset_thread_area\fP(2) 2.6
648 \fBset_tid_address\fP(2) 2.6
649 \fBset_tls\fP(2) 2.6.11 T{
650 ARM OABI/EABI only (constant
652 has \fB__ARM_NR\fP prefix)
654 \fBsetaltroot\fP(2) 2.6.10 T{
655 Removed in 2.6.11, exposed one
656 of implementation details of
657 \fBpersonality\fP(2) (creating an
658 alternative root, precursor of
659 mount namespaces) to user space.
661 .\" See http://lkml.org/lkml/2005/8/1/83
662 .\" "[PATCH] remove sys_set_zone_reclaim()"
663 \fBsetdomainname\fP(2) 1.0
664 \fBsetfsgid\fP(2) 1.2
665 \fBsetfsgid32\fP(2) 2.4
666 \fBsetfsuid\fP(2) 1.2
667 \fBsetfsuid32\fP(2) 2.4
669 \fBsetgid32\fP(2) 2.4
670 \fBsetgroups\fP(2) 1.0
671 \fBsetgroups32\fP(2) 2.4
672 .\" arch/alpha/include/asm/core_lca.h
673 \fBsethae\fP(2) 2.0 Alph only; see NOTES
674 \fBsethostname\fP(2) 1.0
675 \fBsetitimer\fP(2) 1.0
678 \fBsetpgrp\fP(2) 2.0 T{
681 \fBsetpgid\fP(2) on Alpha
683 \fBsetpriority\fP(2) 1.0
684 \fBsetregid\fP(2) 1.0
685 \fBsetregid32\fP(2) 2.4
686 \fBsetresgid\fP(2) 2.2
687 \fBsetresgid32\fP(2) 2.4
688 \fBsetresuid\fP(2) 2.2
689 \fBsetresuid32\fP(2) 2.4
690 \fBsetreuid\fP(2) 1.0
691 \fBsetreuid32\fP(2) 2.4
692 \fBsetrlimit\fP(2) 1.0
694 \fBsetsockopt\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
695 \fBsettimeofday\fP(2) 1.0
697 \fBsetuid32\fP(2) 2.4
698 \fBsetup\fP(2) 1.0 Removed in 2.2
699 \fBsetxattr\fP(2) 2.6; 2.4.18
700 \fBsgetmask\fP(2) 1.0
701 \fBshmat\fP(2) 2.0 See notes on \fBipc\fP(2)
702 \fBshmctl\fP(2) 2.0 See notes on \fBipc\fP(2)
703 \fBshmdt\fP(2) 2.0 See notes on \fBipc\fP(2)
704 \fBshmget\fP(2) 2.0 See notes on \fBipc\fP(2)
705 \fBshutdown\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
706 \fBsigaction\fP(2) 1.0
707 \fBsigaltstack\fP(2) 2.2
709 \fBsignalfd\fP(2) 2.6.22
710 \fBsignalfd4\fP(2) 2.6.27
711 \fBsigpending\fP(2) 1.0
712 \fBsigprocmask\fP(2) 1.0
713 \fBsigreturn\fP(2) 1.0
714 \fBsigsuspend\fP(2) 1.0
715 \fBsocket\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
716 \fBsocketcall\fP(2) 1.0
717 .\" Implements BSD socket calls
718 \fBsocketpair\fP(2) 2.0 See notes on \fBsocketcall\fP(2)
719 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
720 \fBspill\fP(2) 2.6.13 Xtensa only
721 \fBsplice\fP(2) 2.6.17
722 \fBspu_create\fP(2) 2.6.16 PowerPC/PowerPC64 only
723 \fBspu_run\fP(2) 2.6.16 PowerPC/PowerPC64 only
724 \fBsram_alloc\fP(2) 2.6.22 T{
725 Blackfin (port removed
729 \fBsram_free\fP(2) 2.6.22 T{
730 Blackfin (port removed
734 \fBssetmask\fP(2) 1.0
738 \fBstatfs64\fP(2) 2.6
741 \fBsubpage_prot\fP(2) 2.6.25 PowerPC/PowerPC64 only
742 \fBswapcontext\fP(2) 2.6.3 PowerPC/PowerPC64 only
743 .\" 529d235a0e190ded1d21ccc80a73e625ebcad09b
744 \fBswitch_endian\fP(2) 4.1 PowerPC64 only
745 \fBswapcontext\fP(2) 2.6.3 PowerPC only
749 \fBsymlinkat\fP(2) 2.6.16
751 \fBsync_file_range\fP(2) 2.6.17
752 \fBsync_file_range2\fP(2) 2.6.22
753 .\" PowerPC, ARM, tile
754 .\" First appeared on ARM, as arm_sync_file_range(), but later renamed
755 .\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32
756 \fBsyncfs\fP(2) 2.6.39
757 \fBsys_debug_setcontext\fP(2) 2.6.11 PowerPC only
758 \fBsyscall\fP(2) 1.0 T{
759 Still available on ARM OABI
766 .\" glibc interface is \fBklogctl\fP(3)
767 \fBsysmips\fP(2) 2.6.0 MIPS only
771 \fBtimer_create\fP(2) 2.6
772 \fBtimer_delete\fP(2) 2.6
773 \fBtimer_getoverrun\fP(2) 2.6
774 \fBtimer_gettime\fP(2) 2.6
775 \fBtimer_settime\fP(2) 2.6
776 .\" b215e283992899650c4271e7385c79e26fb9a88e
777 .\" 4d672e7ac79b5ec5cdc90e450823441e20464691
778 \fBtimerfd\fP(2) 2.6.22 T{
779 Old timerfd interface,
782 \fBtimerfd_create\fP(2) 2.6.25
783 \fBtimerfd_gettime\fP(2) 2.6.25
784 \fBtimerfd_settime\fP(2) 2.6.25
786 \fBtkill\fP(2) 2.6; 2.4.22
787 \fBtruncate\fP(2) 1.0
788 \fBtruncate64\fP(2) 2.4
789 \fBugetrlimit\fP(2) 2.4
792 .\" sys_oldumount() -- __NR_umount
794 .\" sys_umount() -- __NR_umount2
797 \fBunlinkat\fP(2) 2.6.16
798 \fBunshare\fP(2) 2.6.16
801 \fBuserfaultfd\fP(2) 4.3
802 \fBusr26\fP(2) 2.4.8.1 ARM OABI only
803 \fBusr32\fP(2) 2.4.8.1 ARM OABI only
805 \fButimensat\fP(2) 2.6.22
807 \fButrap_install\fP(2) 2.2 SPARC64 only
808 .\" FIXME . document utrap_install()
809 .\" There's a man page for Solaris 5.11
812 \fBvm86old\fP(2) 1.0 T{
813 Was "vm86"; renamed in
816 \fBvm86\fP(2) 2.0.28; 2.2
817 \fBvmsplice\fP(2) 2.6.17
819 \fBwaitid\fP(2) 2.6.10
823 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
824 \fBxtensa\fP(2) 2.6.13 Xtensa only
828 On many platforms, including x86-32, socket calls are all multiplexed
829 (via glibc wrapper functions) through
831 and similarly System\ V IPC calls are multiplexed through
834 Although slots are reserved for them in the system call table,
835 the following system calls are not implemented in the standard kernel:
836 .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
837 .BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386
838 .BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386
839 .BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386
840 .BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386
841 .BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386
842 .BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386
843 .BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386
844 .BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386
845 .BR phys (2), \" Slot has been reused
846 .BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386
847 .BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386
848 .BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386
849 .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
850 .\" on a couple of 2.6 architectures
851 .BR security (2), \" __NR_security is 223 on Linux 2.4/i386
852 .\" The security call is for future use.
853 .BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386
854 .BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
855 .BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386
857 .BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386
859 .BR unimplemented (2)).
865 exist as library routines.
868 is in use since kernel 2.1.116 for
871 will never be implemented.
876 calls are for kernels patched to support STREAMS,
877 and may never be in the standard kernel.
880 .BR set_zone_reclaim (2),
881 added in Linux 2.6.13, and removed in 2.6.16;
882 this system call was never available to user space.
885 Roughly speaking, the code belonging to the system call
886 with number __NR_xxx defined in
887 .I /usr/include/asm/unistd.h
888 can be found in the Linux kernel source in the routine
890 (The dispatch table for i386 can be found in
891 .IR /usr/src/linux/arch/i386/kernel/entry.S .)
892 There are many exceptions, however, mostly because
893 older system calls were superseded by newer ones,
894 and this has been treated somewhat unsystematically.
896 proprietary operating-system emulation,
897 such as sparc, sparc64, and alpha,
898 there are many additional system calls; mips64 also contains a full
899 set of 32-bit system calls.
901 Over time, changes to the interfaces of some system calls have been
903 One reason for such changes was the need to increase the size of
904 structures or scalar values passed to the system call.
905 Because of these changes, certain architectures
906 (notably, longstanding 32-bit architectures such as i386)
907 now have various groups of related system calls (e.g.,
911 which perform similar tasks, but which vary in
912 details such as the size of their arguments.
913 (As noted earlier, applications are generally unaware of this:
914 the glibc wrapper functions do some work to ensure that the right
915 system call is invoked, and that ABI compatibility is
916 preserved for old binaries.)
917 Examples of systems calls that exist in multiple versions are
920 By now there are three different versions of
932 with the last being the most current.
933 .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
934 .\" The stat system calls deal with three different data structures,
935 .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
936 A similar story applies for
941 Similarly, the defines
942 .IR __NR_oldolduname ,
946 refer to the routines
952 In Linux 2.0, a new version of
954 appeared, with the old and the new kernel routines being named
959 In Linux 2.4, a new version of
961 appeared, with the old and the new kernel routines being named
962 .IR sys_old_getrlimit ()
968 .IR __NR_ugetrlimit ).
970 Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
971 .\" 64-bit off_t changes: ftruncate64, *stat64,
972 .\" fcntl64 (because of the flock structure), getdents64, *statfs64
973 To support this change, a range of system calls were added
978 .BR setresuid32 (2)),
979 superseding earlier calls of the same name without the
982 Linux 2.4 added support for applications on 32-bit architectures
983 to access large files (i.e., files for which the sizes and
984 file offsets can't be represented in 32 bits.)
985 To support this change, replacements were required for system calls
986 that deal with file offsets and sizes.
987 Thus the following system calls were added:
993 and their analogs that work with file descriptors or
995 These system calls supersede the older system calls
996 which, except in the case of the "stat" calls,
997 have the same name without the "64" suffix.
999 On newer platforms that only have 64-bit file access and 32-bit UIDs/GIDs
1000 (e.g., alpha, ia64, s390x, x86-64), there is just a single version of
1001 the UID/GID and file access system calls.
1002 On platforms (typically, 32-bit platforms) where the *64 and *32 calls exist,
1003 the other versions are obsolete.
1007 calls were added in kernel 2.2 to support the addition
1008 of real-time signals (see
1010 These system calls supersede the older system calls of the same
1011 name without the "rt_" prefix.
1017 system calls use five or more arguments,
1018 which caused problems in the way
1019 argument passing on the i386 used to be set up.
1020 Thus, while other architectures have
1032 (routines that use a pointer to an
1033 argument block) instead.
1034 These days passing five arguments
1035 is not a problem any more, and there is a
1037 .\" (used by libc 6)
1038 that corresponds directly to
1042 s390x is the only 64-bit architecture that has
1045 .\" Two system call numbers,
1046 .\" .IR __NR__llseek
1048 .\" .IR __NR__sysctl
1049 .\" have an additional underscore absent in
1050 .\" .IR sys_llseek ()
1052 .\" .IR sys_sysctl ().
1054 .\" In kernel 2.1.81,
1058 .\" were swapped; that is,
1060 .\" was added with the semantics that were then current for
1062 .\" and the semantics of the latter call were changed to what
1066 .SS "Architecture-specific details: Alpha"
1069 returns a pair of GID and effective GID via registers
1070 \fBr0\fP and \fBr20\fP; it is provided
1072 \fBgetgid\fP(2) and \fBgetegid\fP(2).
1075 returns a pair of PID and parent PID via registers
1076 \fBr0\fP and \fBr20\fP; it is provided instead of
1077 \fBgetpid\fP(2) and \fBgetppid\fP(2).
1079 .BR old_adjtimex (2)
1080 is a variant of \fBadjtimex\fP(2) that uses \fIstruct timeval32\fP,
1081 for compatibility with OSF/1.
1084 returns a pair of GID and effective GID via registers
1085 \fBr0\fP and \fBr20\fP; it is provided instead of
1086 \fBgetuid\fP(2) and \fBgeteuid\fP(2).
1089 is used for configuring the Host Address Extension register on
1090 low-cost Alphas in order to access address space beyond first 27 bits.
1094 .BR unimplemented (2),