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 2021-03-22 "Linux" "Linux Programmer's Manual"
33 syscalls \- Linux system calls
39 The system call is the fundamental interface between an application
41 .SS System calls and library wrapper functions
42 System calls are generally not invoked directly,
43 but rather via wrapper functions in glibc (or perhaps some other library).
44 For details of direct invocation of a system call, see
46 Often, but not always, the name of the wrapper function is the same
47 as the name of the system call that it invokes.
48 For example, glibc contains a function
50 which invokes the underlying "chdir" system call.
52 Often the glibc wrapper function is quite thin, doing little work
53 other than copying arguments to the right registers
54 before invoking the system call,
57 appropriately after the system call has returned.
58 (These are the same steps that are performed by
60 which can be used to invoke system calls
61 for which no wrapper function is provided.)
62 Note: system calls indicate a failure by returning a negative error
63 number to the caller on architectures without a separate error register/flag,
67 the wrapper function negates the returned error number
68 (to make it positive), copies it to
70 and returns \-1 to the caller of the wrapper.
72 Sometimes, however, the wrapper function does some extra work
73 before invoking the system call.
74 For example, nowadays there are (for reasons described below) two
81 wrapper function checks which of those system calls
82 are provided by the kernel and determines which should be employed.
84 Below is a list of the Linux system calls.
87 column indicates the kernel version
88 for those system calls that were new in Linux 2.2,
89 or have appeared since that kernel version.
90 Note the following points:
92 Where no kernel version is indicated,
93 the system call appeared in kernel 1.0 or earlier.
95 Where a system call is marked "1.2"
96 this means the system call probably appeared in a 1.1.x kernel version,
97 and first appeared in a stable kernel with 1.2.
98 (Development of the 1.2 kernel was initiated from a branch of kernel
99 1.0.6 via the 1.1.x unstable kernel series.)
101 Where a system call is marked "2.0"
102 this means the system call probably appeared in a 1.3.x kernel version,
103 and first appeared in a stable kernel with 2.0.
104 (Development of the 2.0 kernel was initiated from a branch of kernel
105 1.2.x, somewhere around 1.2.10,
106 via the 1.3.x unstable kernel series.)
107 .\" Was kernel 2.0 started from a branch of 1.2.10?
108 .\" At least from the timestamps of the tarballs of
109 .\" of 1.2.10 and 1.3.0, that's how it looks, but in
110 .\" fact the diff doesn't seem very clear, the
111 .\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the
112 .\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the
113 .\" timestamps of some files in 1.3.0 seem to be older
114 .\" than those in 1.2.10. All of this suggests
115 .\" that there might not have been a clean branch point.
117 Where a system call is marked "2.2"
118 this means the system call probably appeared in a 2.1.x kernel version,
119 and first appeared in a stable kernel with 2.2.0.
120 (Development of the 2.2 kernel was initiated from a branch of kernel
121 2.0.21 via the 2.1.x unstable kernel series.)
123 Where a system call is marked "2.4"
124 this means the system call probably appeared in a 2.3.x kernel version,
125 and first appeared in a stable kernel with 2.4.0.
126 (Development of the 2.4 kernel was initiated from a branch of
127 kernel 2.2.8 via the 2.3.x unstable kernel series.)
129 Where a system call is marked "2.6"
130 this means the system call probably appeared in a 2.5.x kernel version,
131 and first appeared in a stable kernel with 2.6.0.
132 (Development of kernel 2.6 was initiated from a branch
133 of kernel 2.4.15 via the 2.5.x unstable kernel series.)
135 Starting with kernel 2.6.0, the development model changed,
136 and new system calls may appear in each 2.6.x release.
137 In this case, the exact version number where the system call appeared
139 This convention continues with the 3.x kernel series,
140 which followed on from kernel 2.6.39; and the 4.x kernel series,
141 which followed on from kernel 3.19; and the 5.x kernel series,
142 which followed on from kernel 4.20.
144 In some cases, a system call was added to a stable kernel
145 series after it branched from the previous stable kernel
146 series, and then backported into the earlier stable kernel series.
147 For example some system calls that appeared in 2.6.x were also backported
148 into a 2.4.x release after 2.4.15.
149 When this is so, the version where the system call appeared
150 in both of the major kernel series is listed.
152 The list of system calls that are available as at kernel 5.11
153 (or in a few cases only on older kernels) is as follows:
155 .\" Looking at scripts/checksyscalls.sh in the kernel source is
156 .\" instructive about x86 specifics.
164 \fBSystem call\fP \fBKernel\fP \fBNotes\fP
167 \fB_newselect\fP(2) 2.0
168 \fB_sysctl\fP(2) 2.0 Removed in 5.5
169 \fBaccept\fP(2) 2.0 T{
170 See notes on \fBsocketcall\fP(2)
172 \fBaccept4\fP(2) 2.6.28
175 \fBadd_key\fP(2) 2.6.10
176 \fBadjtimex\fP(2) 1.0
178 \fBalloc_hugepages\fP(2) 2.5.36 Removed in 2.5.44
179 .\" 4adeefe161a74369e44cc8e663f240ece0470dc3
180 \fBarc_gettls\fP(2) 3.9 ARC only
181 \fBarc_settls\fP(2) 3.9 ARC only
182 .\" 91e040a79df73d371f70792f30380d4e44805250
183 \fBarc_usr_cmpxchg\fP(2) 4.9 ARC only
184 .\" x86: 79170fda313ed5be2394f87aa2a00d597f8ed4a1
185 \fBarch_prctl\fP(2) 2.6 T{
186 x86_64, x86 since 4.12
188 .\" 9674cdc74d63f346870943ef966a034f8c71ee57
189 \fBatomic_barrier\fP(2) 2.6.34 m68k only
190 \fBatomic_cmpxchg_32\fP(2) 2.6.34 m68k only
191 \fBbdflush\fP(2) 1.2 T{
192 Deprecated (does nothing)
196 See notes on \fBsocketcall\fP(2)
200 \fBbreakpoint\fP(2) 2.2 T{
201 ARM OABI only, defined with
202 \fB__ARM_NR\fP prefix
204 \fBcacheflush\fP(2) 1.2 Not on x86
209 \fBchown\fP(2) 2.2 T{
210 See \fBchown\fP(2) for
215 \fBclock_adjtime\fP(2) 2.6.39
216 \fBclock_getres\fP(2) 2.6
217 \fBclock_gettime\fP(2) 2.6
218 \fBclock_nanosleep\fP(2) 2.6
219 \fBclock_settime\fP(2) 2.6
220 \fBclone2\fP(2) 2.4 IA-64 only
224 \fBclose_range\fP(2) 5.9
225 .\" .\" dcef1f634657dabe7905af3ccda12cf7f0b6fcc1
226 .\" .\" cc20d42986d5807cbe4f5c7c8e3dab2e59ea0db3
227 .\" .\" db695c0509d6ec9046ee5e4c520a19fa17d9fce2
228 .\" \fBcmpxchg\fP(2) 2.6.12 T{
229 .\" ARM, syscall constant never was
230 .\" exposed to user space, in-kernel
231 .\" definition had \fB__ARM_NR\fP prefix,
234 .\" 867e359b97c970a60626d5d76bbe2a8fadbf38fb
235 .\" bb9d812643d8a121df7d614a2b9c60193a92deb0
236 \fBconnect\fP(2) 2.0 T{
237 See notes on \fBsocketcall\fP(2)
239 \fBcopy_file_range\fP(2) 4.5
241 \fBcreate_module\fP(2) 1.0 Removed in 2.6
242 \fBdelete_module\fP(2) 1.0
243 .\" 1394f03221790a988afc3e4b3cb79f2e477246a9
244 .\" 4ba66a9760722ccbb691b8f7116cad2f791cca7b
248 \fBepoll_create\fP(2) 2.6
249 \fBepoll_create1\fP(2) 2.6.27
250 \fBepoll_ctl\fP(2) 2.6
251 \fBepoll_pwait\fP(2) 2.6.19
252 \fBepoll_pwait2\fP(2) 5.11
253 \fBepoll_wait\fP(2) 2.6
254 \fBeventfd\fP(2) 2.6.22
255 \fBeventfd2\fP(2) 2.6.27
256 \fBexecv\fP(2) 2.0 T{
257 SPARC/SPARC64 only, for
258 compatibility with SunOS
261 \fBexecveat\fP(2) 3.19
263 \fBexit_group\fP(2) 2.6
264 \fBfaccessat\fP(2) 2.6.16
265 \fBfaccessat2\fP(2) 5.8
266 \fBfadvise64\fP(2) 2.6
267 .\" Implements \fBposix_fadvise\fP(2)
268 \fBfadvise64_64\fP(2) 2.6
269 \fBfallocate\fP(2) 2.6.23
270 \fBfanotify_init\fP(2) 2.6.37
271 \fBfanotify_mark\fP(2) 2.6.37
272 .\" The fanotify calls were added in Linux 2.6.36,
273 .\" but disabled while the API was finalized.
276 \fBfchmodat\fP(2) 2.6.16
278 \fBfchown32\fP(2) 2.4
279 \fBfchownat\fP(2) 2.6.16
282 \fBfdatasync\fP(2) 2.0
283 \fBfgetxattr\fP(2) 2.6; 2.4.18
284 \fBfinit_module\fP(2) 3.8
285 \fBflistxattr\fP(2) 2.6; 2.4.18
288 \fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44
289 \fBfremovexattr\fP(2) 2.6; 2.4.18
290 \fBfsconfig\fP(2) 5.2
291 \fBfsetxattr\fP(2) 2.6; 2.4.18
297 \fBfstatat64\fP(2) 2.6.16
299 \fBfstatfs64\fP(2) 2.6
301 \fBftruncate\fP(2) 1.0
302 \fBftruncate64\fP(2) 2.4
304 \fBfutimesat\fP(2) 2.6.16
305 \fBget_kernel_syms\fP(2) 1.0 Removed in 2.6
306 \fBget_mempolicy\fP(2) 2.6.6
307 \fBget_robust_list\fP(2) 2.6.17
308 \fBget_thread_area\fP(2) 2.6
309 .\" 8fcd6c45f5a65621ec809b7866a3623e9a01d4ed
310 \fBget_tls\fP(2) 4.15 T{
312 \fB__ARM_NR\fP prefix
314 \fBgetcpu\fP(2) 2.6.19
316 \fBgetdents\fP(2) 2.0
317 \fBgetdents64\fP(2) 2.4
318 .\" parisc: 863722e856e64dae0e252b6bb546737c6c5626ce
319 \fBgetdomainname\fP(2) 2.2 T{
320 SPARC, SPARC64; available
321 as \fBosf_getdomainname\fP(2)
322 on Alpha since Linux 2.0
324 .\" ec98c6b9b47df6df1c1fa6cf3d427414f8c2cf16
325 \fBgetdtablesize\fP(2) 2.0 T{
326 SPARC (removed in 2.6.26),
327 available on Alpha as
328 \fBosf_getdtablesize\fP(2)
331 \fBgetegid32\fP(2) 2.4
333 \fBgeteuid32\fP(2) 2.4
335 \fBgetgid32\fP(2) 2.4
336 \fBgetgroups\fP(2) 1.0
337 \fBgetgroups32\fP(2) 2.4
338 .\" SPARC removal: ec98c6b9b47df6df1c1fa6cf3d427414f8c2cf16
339 \fBgethostname\fP(2) 2.0 T{
340 Alpha, was available on
341 SPARC up to Linux 2.6.26
343 \fBgetitimer\fP(2) 1.0
344 \fBgetpeername\fP(2) 2.0 T{
345 See notes on \fBsocketcall\fP(2)
347 \fBgetpagesize\fP(2) 2.0 Not on x86
352 \fBgetpriority\fP(2) 1.0
353 \fBgetrandom\fP(2) 3.17
354 \fBgetresgid\fP(2) 2.2
355 \fBgetresgid32\fP(2) 2.4
356 \fBgetresuid\fP(2) 2.2
357 \fBgetresuid32\fP(2) 2.4
358 \fBgetrlimit\fP(2) 1.0
359 \fBgetrusage\fP(2) 1.0
361 \fBgetsockname\fP(2) 2.0 T{
362 See notes on \fBsocketcall\fP(2)
364 \fBgetsockopt\fP(2) 2.0 T{
365 See notes on \fBsocketcall\fP(2)
367 \fBgettid\fP(2) 2.4.11
368 \fBgettimeofday\fP(2) 1.0
370 \fBgetuid32\fP(2) 2.4
371 \fBgetunwind\fP(2) 2.4.8 T{
372 IA-64 only; deprecated
374 \fBgetxattr\fP(2) 2.6; 2.4.18
375 \fBgetxgid\fP(2) 2.0 T{
376 Alpha only; see NOTES
378 \fBgetxpid\fP(2) 2.0 T{
379 Alpha only; see NOTES
381 \fBgetxuid\fP(2) 2.0 T{
382 Alpha only; see NOTES
384 \fBinit_module\fP(2) 1.0
385 \fBinotify_add_watch\fP(2) 2.6.13
386 \fBinotify_init\fP(2) 2.6.13
387 \fBinotify_init1\fP(2) 2.6.27
388 \fBinotify_rm_watch\fP(2) 2.6.13
389 \fBio_cancel\fP(2) 2.6
390 \fBio_destroy\fP(2) 2.6
391 \fBio_getevents\fP(2) 2.6
392 \fBio_pgetevents\fP(2) 4.18
393 \fBio_setup\fP(2) 2.6
394 \fBio_submit\fP(2) 2.6
395 \fBio_uring_enter\fP(2) 5.1
396 \fBio_uring_register\fP(2) 5.1
397 \fBio_uring_setup\fP(2) 5.1
401 \fBioprio_get\fP(2) 2.6.13
402 \fBioprio_set\fP(2) 2.6.13
404 .\" Implements System V IPC calls
406 \fBkern_features\fP(2) 3.7 SPARC64 only
407 .\" FIXME . document kern_features():
408 .\" commit 517ffce4e1a03aea979fe3a18a3dd1761a24fafb
409 \fBkexec_file_load\fP(2) 3.17
410 \fBkexec_load\fP(2) 2.6.13
411 .\" The entry in the syscall table was reserved starting in 2.6.7
412 .\" Was named sys_kexec_load() from 2.6.7 to 2.6.16
413 \fBkeyctl\fP(2) 2.6.10
415 \fBlandlock_add_rule\fP(2) 5.13
416 \fBlandlock_create_ruleset\fP(2) 5.13
417 \fBlandlock_restrict_self\fP(2) 5.13
418 \fBlandlock_add_rule\fP(2) 5.13
419 \fBlchown\fP(2) 1.0 T{
420 See \fBchown\fP(2) for
423 \fBlchown32\fP(2) 2.4
424 \fBlgetxattr\fP(2) 2.6; 2.4.18
426 \fBlinkat\fP(2) 2.6.16
427 \fBlisten\fP(2) 2.0 T{
428 See notes on \fBsocketcall\fP(2)
430 \fBlistxattr\fP(2) 2.6; 2.4.18
431 \fBllistxattr\fP(2) 2.6; 2.4.18
432 \fBlookup_dcookie\fP(2) 2.6
433 \fBlremovexattr\fP(2) 2.6; 2.4.18
435 \fBlsetxattr\fP(2) 2.6; 2.4.18
440 \fBmemory_ordering\fP(2) 2.2 SPARC64 only
441 .\" 26025bbfbba33a9425be1b89eccb4664ea4c17b6
442 .\" bb6fb6dfcc17cddac11ac295861f7608194447a7
443 \fBmembarrier\fP(2) 3.17
444 \fBmemfd_create\fP(2) 3.17
445 \fBmigrate_pages\fP(2) 2.6.16
448 \fBmkdirat\fP(2) 2.6.16
450 \fBmknodat\fP(2) 2.6.16
453 \fBmlockall\fP(2) 2.0
456 \fBmodify_ldt\fP(2) 1.0
458 \fBmove_mount\fP(2) 5.2
459 \fBmove_pages\fP(2) 2.6.18
460 \fBmprotect\fP(2) 1.0
461 \fBmq_getsetattr\fP(2) 2.6.6
462 .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
463 \fBmq_notify\fP(2) 2.6.6
464 \fBmq_open\fP(2) 2.6.6
465 \fBmq_timedreceive\fP(2) 2.6.6
466 \fBmq_timedsend\fP(2) 2.6.6
467 \fBmq_unlink\fP(2) 2.6.6
469 \fBmsgctl\fP(2) 2.0 T{
470 See notes on \fBipc\fP(2)
472 \fBmsgget\fP(2) 2.0 T{
473 See notes on \fBipc\fP(2)
475 \fBmsgrcv\fP(2) 2.0 T{
476 See notes on \fBipc\fP(2)
478 \fBmsgsnd\fP(2) 2.0 T{
479 See notes on \fBipc\fP(2)
482 .\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on
483 .\" PowerPC, but unimplemented?
485 \fBmunlockall\fP(2) 2.0
487 \fBname_to_handle_at\fP(2) 2.6.39
488 \fBnanosleep\fP(2) 2.0
489 .\" 5590ff0d5528b60153c0b4e7b771472b5a95e297
490 \fBnewfstatat\fP(2) 2.6.16 See \fBstat\fP(2)
491 \fBnfsservctl\fP(2) 2.2 Removed in 3.1
493 \fBold_adjtimex\fP(2) 2.0 T{
494 Alpha only; see NOTES
496 \fBold_getrlimit\fP(2) 2.4 T{
497 Old variant of \fBgetrlimit\fP(2)
498 that used a different value
499 for \fBRLIM_INFINITY\fP
501 \fBoldfstat\fP(2) 1.0
502 \fBoldlstat\fP(2) 1.0
503 \fBoldolduname\fP(2) 1.0
505 \fBoldumount\fP(2) 2.4.116 T{
506 Name of the old \fBumount\fP(2)
509 \fBolduname\fP(2) 1.0
511 \fBopen_by_handle_at\fP(2) 2.6.39
512 \fBopen_tree\fP(2) 5.2
513 \fBopenat\fP(2) 2.6.16
515 .\" 9d02a4283e9ce4e9ca11ff00615bdacdb0515a1a
516 \fBor1k_atomic\fP(2) 3.1 T{
520 \fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on x86
521 .\" Alpha, PowerPC, ARM; not x86
522 \fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on x86
523 .\" , PowerPC, ARM; not x86
524 \fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on x86
525 .\" , PowerPC, ARM; not x86
526 \fBperf_event_open\fP(2) 2.6.31 T{
527 Was perf_counter_open() in
528 2.6.31; renamed in 2.6.32
530 \fBpersonality\fP(2) 1.2
531 \fBperfctr\fP(2) 2.2 T{
532 SPARC only; removed in 2.6.34
534 .\" commit c7d5a0050773e98d1094eaa9f2a1a793fafac300 removed perfctr()
535 \fBperfmonctl\fP(2) 2.4 IA-64 only; removed in 5.10
536 \fBpidfd_getfd\fP(2) 5.6
537 \fBpidfd_send_signal\fP(2) 5.1
538 \fBpidfd_open\fP(2) 5.3
540 \fBpipe2\fP(2) 2.6.27
541 \fBpivot_root\fP(2) 2.4
542 \fBpkey_alloc\fP(2) 4.8
543 \fBpkey_free\fP(2) 4.8
544 \fBpkey_mprotect\fP(2) 4.8
545 \fBpoll\fP(2) 2.0.36; 2.2
546 \fBppoll\fP(2) 2.6.16
549 Added as "pread" in 2.2;
550 renamed "pread64" in 2.6
552 \fBpreadv\fP(2) 2.6.30
554 \fBprlimit64\fP(2) 2.6.36
555 \fBprocess_madvise\fP(2) 5.10
556 \fBprocess_vm_readv\fP(2) 3.2
557 \fBprocess_vm_writev\fP(2) 3.2
558 \fBpselect6\fP(2) 2.6.16
559 .\" Implements \fBpselect\fP(2)
562 Added as "pwrite" in 2.2;
563 renamed "pwrite64" in 2.6
565 \fBpwritev\fP(2) 2.6.30
566 \fBpwritev2\fP(2) 4.6
567 \fBquery_module\fP(2) 2.2 Removed in 2.6
568 \fBquotactl\fP(2) 1.0
569 \fBquotactl_fd\fP(2) 5.14
571 \fBreadahead\fP(2) 2.4.13
573 .\" Supersedes \fBgetdents\fP(2)
574 \fBreadlink\fP(2) 1.0
575 \fBreadlinkat\fP(2) 2.6.16
579 See notes on \fBsocketcall\fP(2)
581 \fBrecvfrom\fP(2) 2.0 T{
582 See notes on \fBsocketcall\fP(2)
584 \fBrecvmsg\fP(2) 2.0 T{
585 See notes on \fBsocketcall\fP(2)
587 \fBrecvmmsg\fP(2) 2.6.33
588 \fBremap_file_pages\fP(2) 2.6 T{
589 Deprecated since 3.16
591 \fBremovexattr\fP(2) 2.6; 2.4.18
593 \fBrenameat\fP(2) 2.6.16
594 \fBrenameat2\fP(2) 3.15
595 \fBrequest_key\fP(2) 2.6.10
596 \fBrestart_syscall\fP(2) 2.6
597 .\" 921ebd8f2c081b3cf6c3b29ef4103eef3ff26054
598 \fBriscv_flush_icache\fP(2) 4.15 RISC-V only
601 \fBrt_sigaction\fP(2) 2.2
602 \fBrt_sigpending\fP(2) 2.2
603 \fBrt_sigprocmask\fP(2) 2.2
604 \fBrt_sigqueueinfo\fP(2) 2.2
605 \fBrt_sigreturn\fP(2) 2.2
606 \fBrt_sigsuspend\fP(2) 2.2
607 \fBrt_sigtimedwait\fP(2) 2.2
608 \fBrt_tgsigqueueinfo\fP(2) 2.6.31
609 \fBrtas\fP(2) 2.6.2 T{
610 PowerPC/PowerPC64 only
612 \fBs390_runtime_instr\fP(2) 3.7 s390 only
613 \fBs390_pci_mmio_read\fP(2) 3.19 s390 only
614 \fBs390_pci_mmio_write\fP(2) 3.19 s390 only
615 \fBs390_sthyi\fP(2) 4.15 s390 only
616 \fBs390_guarded_storage\fP(2) 4.12 s390 only
617 \fBsched_get_affinity\fP(2) 2.6 T{
618 Name of \fBsched_getaffinity\fP(2)
621 \fBsched_get_priority_max\fP(2) 2.0
622 \fBsched_get_priority_min\fP(2) 2.0
623 \fBsched_getaffinity\fP(2) 2.6
624 \fBsched_getattr\fP(2) 3.14
625 \fBsched_getparam\fP(2) 2.0
626 \fBsched_getscheduler\fP(2) 2.0
627 \fBsched_rr_get_interval\fP(2) 2.0
628 \fBsched_set_affinity\fP(2) 2.6 T{
629 Name of \fBsched_setaffinity\fP(2)
632 \fBsched_setaffinity\fP(2) 2.6
633 \fBsched_setattr\fP(2) 3.14
634 \fBsched_setparam\fP(2) 2.0
635 \fBsched_setscheduler\fP(2) 2.0
636 \fBsched_yield\fP(2) 2.0
637 \fBseccomp\fP(2) 3.17
639 \fBsemctl\fP(2) 2.0 T{
640 See notes on \fBipc\fP(2)
642 \fBsemget\fP(2) 2.0 T{
643 See notes on \fBipc\fP(2)
645 \fBsemop\fP(2) 2.0 T{
646 See notes on \fBipc\fP(2)
648 \fBsemtimedop\fP(2) 2.6; 2.4.22
650 See notes on \fBsocketcall\fP(2)
652 \fBsendfile\fP(2) 2.2
653 \fBsendfile64\fP(2) 2.6; 2.4.19
654 \fBsendmmsg\fP(2) 3.0
655 \fBsendmsg\fP(2) 2.0 T{
656 See notes on \fBsocketcall\fP(2)
658 \fBsendto\fP(2) 2.0 T{
659 See notes on \fBsocketcall\fP(2)
661 \fBset_mempolicy\fP(2) 2.6.6
662 \fBset_robust_list\fP(2) 2.6.17
663 \fBset_thread_area\fP(2) 2.6
664 \fBset_tid_address\fP(2) 2.6
665 \fBset_tls\fP(2) 2.6.11 T{
666 ARM OABI/EABI only (constant
667 has \fB__ARM_NR\fP prefix)
669 .\" \fBsetaltroot\fP(2) 2.6.10 T{
670 .\" Removed in 2.6.11, exposed one
671 .\" of implementation details of
672 .\" \fBpersonality\fP(2) (creating an
673 .\" alternative root, precursor of
674 .\" mount namespaces) to user space.
676 .\" See http://lkml.org/lkml/2005/8/1/83
677 .\" "[PATCH] remove sys_set_zone_reclaim()"
678 \fBsetdomainname\fP(2) 1.0
679 \fBsetfsgid\fP(2) 1.2
680 \fBsetfsgid32\fP(2) 2.4
681 \fBsetfsuid\fP(2) 1.2
682 \fBsetfsuid32\fP(2) 2.4
684 \fBsetgid32\fP(2) 2.4
685 \fBsetgroups\fP(2) 1.0
686 \fBsetgroups32\fP(2) 2.4
687 .\" arch/alpha/include/asm/core_lca.h
688 \fBsethae\fP(2) 2.0 T{
689 Alpha only; see NOTES
691 \fBsethostname\fP(2) 1.0
692 \fBsetitimer\fP(2) 1.0
695 \fBsetpgrp\fP(2) 2.0 T{
697 \fBsetpgid\fP(2) on Alpha
699 \fBsetpriority\fP(2) 1.0
700 \fBsetregid\fP(2) 1.0
701 \fBsetregid32\fP(2) 2.4
702 \fBsetresgid\fP(2) 2.2
703 \fBsetresgid32\fP(2) 2.4
704 \fBsetresuid\fP(2) 2.2
705 \fBsetresuid32\fP(2) 2.4
706 \fBsetreuid\fP(2) 1.0
707 \fBsetreuid32\fP(2) 2.4
708 \fBsetrlimit\fP(2) 1.0
710 \fBsetsockopt\fP(2) 2.0 T{
711 See notes on \fBsocketcall\fP(2)
713 \fBsettimeofday\fP(2) 1.0
715 \fBsetuid32\fP(2) 2.4
716 \fBsetup\fP(2) 1.0 Removed in 2.2
717 \fBsetxattr\fP(2) 2.6; 2.4.18
718 \fBsgetmask\fP(2) 1.0
719 \fBshmat\fP(2) 2.0 T{
720 See notes on \fBipc\fP(2)
722 \fBshmctl\fP(2) 2.0 T{
723 See notes on \fBipc\fP(2)
725 \fBshmdt\fP(2) 2.0 T{
726 See notes on \fBipc\fP(2)
728 \fBshmget\fP(2) 2.0 T{
729 See notes on \fBipc\fP(2)
731 \fBshutdown\fP(2) 2.0 T{
732 See notes on \fBsocketcall\fP(2)
734 \fBsigaction\fP(2) 1.0
735 \fBsigaltstack\fP(2) 2.2
737 \fBsignalfd\fP(2) 2.6.22
738 \fBsignalfd4\fP(2) 2.6.27
739 \fBsigpending\fP(2) 1.0
740 \fBsigprocmask\fP(2) 1.0
741 \fBsigreturn\fP(2) 1.0
742 \fBsigsuspend\fP(2) 1.0
743 \fBsocket\fP(2) 2.0 T{
744 See notes on \fBsocketcall\fP(2)
746 \fBsocketcall\fP(2) 1.0
747 .\" Implements BSD socket calls
748 \fBsocketpair\fP(2) 2.0 T{
749 See notes on \fBsocketcall\fP(2)
751 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
752 \fBspill\fP(2) 2.6.13 Xtensa only
753 \fBsplice\fP(2) 2.6.17
754 \fBspu_create\fP(2) 2.6.16 T{
755 PowerPC/PowerPC64 only
757 \fBspu_run\fP(2) 2.6.16 T{
758 PowerPC/PowerPC64 only
760 \fBssetmask\fP(2) 1.0
764 \fBstatfs64\fP(2) 2.6
767 \fBsubpage_prot\fP(2) 2.6.25 T{
768 PowerPC/PowerPC64 only
770 \fBswapcontext\fP(2) 2.6.3 T{
771 PowerPC/PowerPC64 only
773 .\" 529d235a0e190ded1d21ccc80a73e625ebcad09b
774 \fBswitch_endian\fP(2) 4.1 PowerPC64 only
778 \fBsymlinkat\fP(2) 2.6.16
780 \fBsync_file_range\fP(2) 2.6.17
781 \fBsync_file_range2\fP(2) 2.6.22
782 .\" PowerPC, ARM, tile
783 .\" First appeared on ARM, as arm_sync_file_range(), but later renamed
784 .\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32
785 \fBsyncfs\fP(2) 2.6.39
786 \fBsys_debug_setcontext\fP(2) 2.6.11 PowerPC only
787 \fBsyscall\fP(2) 1.0 T{
788 Still available on ARM OABI
794 .\" glibc interface is \fBklogctl\fP(3)
795 \fBsysmips\fP(2) 2.6.0 MIPS only
799 \fBtimer_create\fP(2) 2.6
800 \fBtimer_delete\fP(2) 2.6
801 \fBtimer_getoverrun\fP(2) 2.6
802 \fBtimer_gettime\fP(2) 2.6
803 \fBtimer_settime\fP(2) 2.6
804 .\" .\" b215e283992899650c4271e7385c79e26fb9a88e
805 .\" .\" 4d672e7ac79b5ec5cdc90e450823441e20464691
806 .\" \fBtimerfd\fP(2) 2.6.22 T{
807 .\" Old timerfd interface,
808 .\" removed in 2.6.25
810 \fBtimerfd_create\fP(2) 2.6.25
811 \fBtimerfd_gettime\fP(2) 2.6.25
812 \fBtimerfd_settime\fP(2) 2.6.25
814 \fBtkill\fP(2) 2.6; 2.4.22
815 \fBtruncate\fP(2) 1.0
816 \fBtruncate64\fP(2) 2.4
817 \fBugetrlimit\fP(2) 2.4
820 .\" sys_oldumount() -- __NR_umount
822 .\" sys_umount() -- __NR_umount2
825 \fBunlinkat\fP(2) 2.6.16
826 \fBunshare\fP(2) 2.6.16
829 \fBuserfaultfd\fP(2) 4.3
830 \fBusr26\fP(2) 2.4.8.1 ARM OABI only
831 \fBusr32\fP(2) 2.4.8.1 ARM OABI only
833 \fButimensat\fP(2) 2.6.22
835 \fButrap_install\fP(2) 2.2 SPARC64 only
836 .\" FIXME . document utrap_install()
837 .\" There's a man page for Solaris 5.11
840 \fBvm86old\fP(2) 1.0 T{
841 Was "vm86"; renamed in
844 \fBvm86\fP(2) 2.0.28; 2.2
845 \fBvmsplice\fP(2) 2.6.17
847 \fBwaitid\fP(2) 2.6.10
851 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
852 \fBxtensa\fP(2) 2.6.13 Xtensa only
857 On many platforms, including x86-32, socket calls are all multiplexed
858 (via glibc wrapper functions) through
860 and similarly System\ V IPC calls are multiplexed through
863 Although slots are reserved for them in the system call table,
864 the following system calls are not implemented in the standard kernel:
865 .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
866 .BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386
867 .BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386
868 .BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386
869 .BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386
870 .BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386
871 .BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386
872 .BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386
873 .BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386
874 .BR phys (2), \" Slot has been reused
875 .BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386
876 .BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386
877 .BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386
878 .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
879 .\" on a couple of 2.6 architectures
880 .BR security (2), \" __NR_security is 223 on Linux 2.4/i386
881 .\" The security call is for future use.
882 .BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386
883 .BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
884 .BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386
886 .BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386
888 .BR unimplemented (2)).
894 exist as library routines.
897 is in use since kernel 2.1.116 for
900 will never be implemented.
905 calls are for kernels patched to support STREAMS,
906 and may never be in the standard kernel.
909 .BR set_zone_reclaim (2),
910 added in Linux 2.6.13, and removed in 2.6.16;
911 this system call was never available to user space.
913 .SS System calls on removed ports
914 Some system calls only ever existed on Linux architectures that have
915 since been removed from the kernel:
917 AVR32 (port removed in Linux 4.12)
927 Blackfin (port removed in Linux 4.17)
931 .BR bfin_spinlock (2)
932 (added in Linux 2.6.22)
935 (added in Linux 2.6.22)
938 (added in Linux 2.6.22)
941 (added in Linux 2.6.22)
944 (added in Linux 2.6.22)
947 (added in Linux 2.6.22)
951 Metag (port removed in Linux 4.17)
955 .BR metag_get_tls (2)
958 .BR metag_set_fpu_flags (2)
961 .BR metag_set_tls (2)
964 .BR metag_setglobalbit (2)
969 Tile (port removed in Linux 4.17)
973 .BR cmpxchg_badaddr (2)
974 (added in Linux 2.6.36)
978 Roughly speaking, the code belonging to the system call
979 with number __NR_xxx defined in
980 .I /usr/include/asm/unistd.h
981 can be found in the Linux kernel source in the routine
983 There are many exceptions, however, mostly because
984 older system calls were superseded by newer ones,
985 and this has been treated somewhat unsystematically.
987 proprietary operating-system emulation,
988 such as sparc, sparc64, and alpha,
989 there are many additional system calls; mips64 also contains a full
990 set of 32-bit system calls.
992 Over time, changes to the interfaces of some system calls have been
994 One reason for such changes was the need to increase the size of
995 structures or scalar values passed to the system call.
996 Because of these changes, certain architectures
997 (notably, longstanding 32-bit architectures such as i386)
998 now have various groups of related system calls (e.g.,
1002 which perform similar tasks, but which vary in
1003 details such as the size of their arguments.
1004 (As noted earlier, applications are generally unaware of this:
1005 the glibc wrapper functions do some work to ensure that the right
1006 system call is invoked, and that ABI compatibility is
1007 preserved for old binaries.)
1008 Examples of systems calls that exist in multiple versions are
1011 By now there are three different versions of
1023 with the last being the most current.
1024 .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
1025 .\" The stat system calls deal with three different data structures,
1026 .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
1027 A similar story applies for
1032 Similarly, the defines
1033 .IR __NR_oldolduname ,
1037 refer to the routines
1038 .IR sys_olduname (),
1041 .IR sys_newuname ().
1043 In Linux 2.0, a new version of
1045 appeared, with the old and the new kernel routines being named
1050 In Linux 2.4, a new version of
1052 appeared, with the old and the new kernel routines being named
1053 .IR sys_old_getrlimit ()
1055 .IR __NR_getrlimit )
1057 .IR sys_getrlimit ()
1059 .IR __NR_ugetrlimit ).
1061 Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
1062 .\" 64-bit off_t changes: ftruncate64, *stat64,
1063 .\" fcntl64 (because of the flock structure), getdents64, *statfs64
1064 To support this change, a range of system calls were added
1068 .BR getgroups32 (2),
1069 .BR setresuid32 (2)),
1070 superseding earlier calls of the same name without the
1073 Linux 2.4 added support for applications on 32-bit architectures
1074 to access large files (i.e., files for which the sizes and
1075 file offsets can't be represented in 32 bits.)
1076 To support this change, replacements were required for system calls
1077 that deal with file offsets and sizes.
1078 Thus the following system calls were added:
1084 and their analogs that work with file descriptors or
1086 These system calls supersede the older system calls
1087 which, except in the case of the "stat" calls,
1088 have the same name without the "64" suffix.
1090 On newer platforms that only have 64-bit file access and 32-bit UIDs/GIDs
1091 (e.g., alpha, ia64, s390x, x86-64), there is just a single version of
1092 the UID/GID and file access system calls.
1093 On platforms (typically, 32-bit platforms) where the *64 and *32 calls exist,
1094 the other versions are obsolete.
1098 calls were added in kernel 2.2 to support the addition
1099 of real-time signals (see
1101 These system calls supersede the older system calls of the same
1102 name without the "rt_" prefix.
1108 system calls use five or more arguments,
1109 which caused problems in the way
1110 argument passing on the i386 used to be set up.
1111 Thus, while other architectures have
1123 (routines that use a pointer to an
1124 argument block) instead.
1125 These days passing five arguments
1126 is not a problem any more, and there is a
1128 .\" (used by libc 6)
1129 that corresponds directly to
1133 s390x is the only 64-bit architecture that has
1136 .\" Two system call numbers,
1137 .\" .IR __NR__llseek
1139 .\" .IR __NR__sysctl
1140 .\" have an additional underscore absent in
1141 .\" .IR sys_llseek ()
1143 .\" .IR sys_sysctl ().
1145 .\" In kernel 2.1.81,
1149 .\" were swapped; that is,
1151 .\" was added with the semantics that were then current for
1153 .\" and the semantics of the latter call were changed to what
1157 .SS "Architecture-specific details: Alpha"
1160 returns a pair of GID and effective GID via registers
1161 \fBr0\fP and \fBr20\fP; it is provided
1163 \fBgetgid\fP(2) and \fBgetegid\fP(2).
1166 returns a pair of PID and parent PID via registers
1167 \fBr0\fP and \fBr20\fP; it is provided instead of
1168 \fBgetpid\fP(2) and \fBgetppid\fP(2).
1170 .BR old_adjtimex (2)
1171 is a variant of \fBadjtimex\fP(2) that uses \fIstruct timeval32\fP,
1172 for compatibility with OSF/1.
1175 returns a pair of GID and effective GID via registers
1176 \fBr0\fP and \fBr20\fP; it is provided instead of
1177 \fBgetuid\fP(2) and \fBgeteuid\fP(2).
1180 is used for configuring the Host Address Extension register on
1181 low-cost Alphas in order to access address space beyond first 27 bits.
1186 .BR unimplemented (2),