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 \fBlchown\fP(2) 1.0 T{
416 See \fBchown\fP(2) for
419 \fBlchown32\fP(2) 2.4
420 \fBlgetxattr\fP(2) 2.6; 2.4.18
422 \fBlinkat\fP(2) 2.6.16
423 \fBlisten\fP(2) 2.0 T{
424 See notes on \fBsocketcall\fP(2)
426 \fBlistxattr\fP(2) 2.6; 2.4.18
427 \fBllistxattr\fP(2) 2.6; 2.4.18
428 \fBlookup_dcookie\fP(2) 2.6
429 \fBlremovexattr\fP(2) 2.6; 2.4.18
431 \fBlsetxattr\fP(2) 2.6; 2.4.18
436 \fBmemory_ordering\fP(2) 2.2 SPARC64 only
437 .\" 26025bbfbba33a9425be1b89eccb4664ea4c17b6
438 .\" bb6fb6dfcc17cddac11ac295861f7608194447a7
439 \fBmembarrier\fP(2) 3.17
440 \fBmemfd_create\fP(2) 3.17
441 \fBmigrate_pages\fP(2) 2.6.16
444 \fBmkdirat\fP(2) 2.6.16
446 \fBmknodat\fP(2) 2.6.16
449 \fBmlockall\fP(2) 2.0
452 \fBmodify_ldt\fP(2) 1.0
454 \fBmove_mount\fP(2) 5.2
455 \fBmove_pages\fP(2) 2.6.18
456 \fBmprotect\fP(2) 1.0
457 \fBmq_getsetattr\fP(2) 2.6.6
458 .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3)
459 \fBmq_notify\fP(2) 2.6.6
460 \fBmq_open\fP(2) 2.6.6
461 \fBmq_timedreceive\fP(2) 2.6.6
462 \fBmq_timedsend\fP(2) 2.6.6
463 \fBmq_unlink\fP(2) 2.6.6
465 \fBmsgctl\fP(2) 2.0 T{
466 See notes on \fBipc\fP(2)
468 \fBmsgget\fP(2) 2.0 T{
469 See notes on \fBipc\fP(2)
471 \fBmsgrcv\fP(2) 2.0 T{
472 See notes on \fBipc\fP(2)
474 \fBmsgsnd\fP(2) 2.0 T{
475 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 T{
490 Alpha only; see NOTES
492 \fBold_getrlimit\fP(2) 2.4 T{
493 Old variant of \fBgetrlimit\fP(2)
494 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)
505 \fBolduname\fP(2) 1.0
507 \fBopen_by_handle_at\fP(2) 2.6.39
508 \fBopen_tree\fP(2) 5.2
509 \fBopenat\fP(2) 2.6.16
511 .\" 9d02a4283e9ce4e9ca11ff00615bdacdb0515a1a
512 \fBor1k_atomic\fP(2) 3.1 T{
516 \fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on x86
517 .\" Alpha, PowerPC, ARM; not x86
518 \fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on x86
519 .\" , PowerPC, ARM; not x86
520 \fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on x86
521 .\" , PowerPC, ARM; not x86
522 \fBperf_event_open\fP(2) 2.6.31 T{
523 Was perf_counter_open() in
524 2.6.31; renamed in 2.6.32
526 \fBpersonality\fP(2) 1.2
527 \fBperfctr\fP(2) 2.2 T{
528 SPARC only; removed in 2.6.34
530 .\" commit c7d5a0050773e98d1094eaa9f2a1a793fafac300 removed perfctr()
531 \fBperfmonctl\fP(2) 2.4 IA-64 only; removed in 5.10
532 \fBpidfd_getfd\fP(2) 5.6
533 \fBpidfd_send_signal\fP(2) 5.1
534 \fBpidfd_open\fP(2) 5.3
536 \fBpipe2\fP(2) 2.6.27
537 \fBpivot_root\fP(2) 2.4
538 \fBpkey_alloc\fP(2) 4.8
539 \fBpkey_free\fP(2) 4.8
540 \fBpkey_mprotect\fP(2) 4.8
541 \fBpoll\fP(2) 2.0.36; 2.2
542 \fBppoll\fP(2) 2.6.16
545 Added as "pread" in 2.2;
546 renamed "pread64" in 2.6
548 \fBpreadv\fP(2) 2.6.30
550 \fBprlimit64\fP(2) 2.6.36
551 \fBprocess_madvise\fP(2) 5.10
552 \fBprocess_vm_readv\fP(2) 3.2
553 \fBprocess_vm_writev\fP(2) 3.2
554 \fBpselect6\fP(2) 2.6.16
555 .\" Implements \fBpselect\fP(2)
558 Added as "pwrite" in 2.2;
559 renamed "pwrite64" in 2.6
561 \fBpwritev\fP(2) 2.6.30
562 \fBpwritev2\fP(2) 4.6
563 \fBquery_module\fP(2) 2.2 Removed in 2.6
564 \fBquotactl\fP(2) 1.0
566 \fBreadahead\fP(2) 2.4.13
568 .\" Supersedes \fBgetdents\fP(2)
569 \fBreadlink\fP(2) 1.0
570 \fBreadlinkat\fP(2) 2.6.16
574 See notes on \fBsocketcall\fP(2)
576 \fBrecvfrom\fP(2) 2.0 T{
577 See notes on \fBsocketcall\fP(2)
579 \fBrecvmsg\fP(2) 2.0 T{
580 See notes on \fBsocketcall\fP(2)
582 \fBrecvmmsg\fP(2) 2.6.33
583 \fBremap_file_pages\fP(2) 2.6 T{
584 Deprecated since 3.16
586 \fBremovexattr\fP(2) 2.6; 2.4.18
588 \fBrenameat\fP(2) 2.6.16
589 \fBrenameat2\fP(2) 3.15
590 \fBrequest_key\fP(2) 2.6.10
591 \fBrestart_syscall\fP(2) 2.6
592 .\" 921ebd8f2c081b3cf6c3b29ef4103eef3ff26054
593 \fBriscv_flush_icache\fP(2) 4.15 RISC-V only
596 \fBrt_sigaction\fP(2) 2.2
597 \fBrt_sigpending\fP(2) 2.2
598 \fBrt_sigprocmask\fP(2) 2.2
599 \fBrt_sigqueueinfo\fP(2) 2.2
600 \fBrt_sigreturn\fP(2) 2.2
601 \fBrt_sigsuspend\fP(2) 2.2
602 \fBrt_sigtimedwait\fP(2) 2.2
603 \fBrt_tgsigqueueinfo\fP(2) 2.6.31
604 \fBrtas\fP(2) 2.6.2 T{
605 PowerPC/PowerPC64 only
607 \fBs390_runtime_instr\fP(2) 3.7 s390 only
608 \fBs390_pci_mmio_read\fP(2) 3.19 s390 only
609 \fBs390_pci_mmio_write\fP(2) 3.19 s390 only
610 \fBs390_sthyi\fP(2) 4.15 s390 only
611 \fBs390_guarded_storage\fP(2) 4.12 s390 only
612 \fBsched_get_affinity\fP(2) 2.6 T{
613 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)
627 \fBsched_setaffinity\fP(2) 2.6
628 \fBsched_setattr\fP(2) 3.14
629 \fBsched_setparam\fP(2) 2.0
630 \fBsched_setscheduler\fP(2) 2.0
631 \fBsched_yield\fP(2) 2.0
632 \fBseccomp\fP(2) 3.17
634 \fBsemctl\fP(2) 2.0 T{
635 See notes on \fBipc\fP(2)
637 \fBsemget\fP(2) 2.0 T{
638 See notes on \fBipc\fP(2)
640 \fBsemop\fP(2) 2.0 T{
641 See notes on \fBipc\fP(2)
643 \fBsemtimedop\fP(2) 2.6; 2.4.22
645 See notes on \fBsocketcall\fP(2)
647 \fBsendfile\fP(2) 2.2
648 \fBsendfile64\fP(2) 2.6; 2.4.19
649 \fBsendmmsg\fP(2) 3.0
650 \fBsendmsg\fP(2) 2.0 T{
651 See notes on \fBsocketcall\fP(2)
653 \fBsendto\fP(2) 2.0 T{
654 See notes on \fBsocketcall\fP(2)
656 \fBset_mempolicy\fP(2) 2.6.6
657 \fBset_robust_list\fP(2) 2.6.17
658 \fBset_thread_area\fP(2) 2.6
659 \fBset_tid_address\fP(2) 2.6
660 \fBset_tls\fP(2) 2.6.11 T{
661 ARM OABI/EABI only (constant
662 has \fB__ARM_NR\fP prefix)
664 .\" \fBsetaltroot\fP(2) 2.6.10 T{
665 .\" Removed in 2.6.11, exposed one
666 .\" of implementation details of
667 .\" \fBpersonality\fP(2) (creating an
668 .\" alternative root, precursor of
669 .\" mount namespaces) to user space.
671 .\" See http://lkml.org/lkml/2005/8/1/83
672 .\" "[PATCH] remove sys_set_zone_reclaim()"
673 \fBsetdomainname\fP(2) 1.0
674 \fBsetfsgid\fP(2) 1.2
675 \fBsetfsgid32\fP(2) 2.4
676 \fBsetfsuid\fP(2) 1.2
677 \fBsetfsuid32\fP(2) 2.4
679 \fBsetgid32\fP(2) 2.4
680 \fBsetgroups\fP(2) 1.0
681 \fBsetgroups32\fP(2) 2.4
682 .\" arch/alpha/include/asm/core_lca.h
683 \fBsethae\fP(2) 2.0 T{
684 Alpha only; see NOTES
686 \fBsethostname\fP(2) 1.0
687 \fBsetitimer\fP(2) 1.0
690 \fBsetpgrp\fP(2) 2.0 T{
692 \fBsetpgid\fP(2) on Alpha
694 \fBsetpriority\fP(2) 1.0
695 \fBsetregid\fP(2) 1.0
696 \fBsetregid32\fP(2) 2.4
697 \fBsetresgid\fP(2) 2.2
698 \fBsetresgid32\fP(2) 2.4
699 \fBsetresuid\fP(2) 2.2
700 \fBsetresuid32\fP(2) 2.4
701 \fBsetreuid\fP(2) 1.0
702 \fBsetreuid32\fP(2) 2.4
703 \fBsetrlimit\fP(2) 1.0
705 \fBsetsockopt\fP(2) 2.0 T{
706 See notes on \fBsocketcall\fP(2)
708 \fBsettimeofday\fP(2) 1.0
710 \fBsetuid32\fP(2) 2.4
711 \fBsetup\fP(2) 1.0 Removed in 2.2
712 \fBsetxattr\fP(2) 2.6; 2.4.18
713 \fBsgetmask\fP(2) 1.0
714 \fBshmat\fP(2) 2.0 T{
715 See notes on \fBipc\fP(2)
717 \fBshmctl\fP(2) 2.0 T{
718 See notes on \fBipc\fP(2)
720 \fBshmdt\fP(2) 2.0 T{
721 See notes on \fBipc\fP(2)
723 \fBshmget\fP(2) 2.0 T{
724 See notes on \fBipc\fP(2)
726 \fBshutdown\fP(2) 2.0 T{
727 See notes on \fBsocketcall\fP(2)
729 \fBsigaction\fP(2) 1.0
730 \fBsigaltstack\fP(2) 2.2
732 \fBsignalfd\fP(2) 2.6.22
733 \fBsignalfd4\fP(2) 2.6.27
734 \fBsigpending\fP(2) 1.0
735 \fBsigprocmask\fP(2) 1.0
736 \fBsigreturn\fP(2) 1.0
737 \fBsigsuspend\fP(2) 1.0
738 \fBsocket\fP(2) 2.0 T{
739 See notes on \fBsocketcall\fP(2)
741 \fBsocketcall\fP(2) 1.0
742 .\" Implements BSD socket calls
743 \fBsocketpair\fP(2) 2.0 T{
744 See notes on \fBsocketcall\fP(2)
746 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
747 \fBspill\fP(2) 2.6.13 Xtensa only
748 \fBsplice\fP(2) 2.6.17
749 \fBspu_create\fP(2) 2.6.16 T{
750 PowerPC/PowerPC64 only
752 \fBspu_run\fP(2) 2.6.16 T{
753 PowerPC/PowerPC64 only
755 \fBssetmask\fP(2) 1.0
759 \fBstatfs64\fP(2) 2.6
762 \fBsubpage_prot\fP(2) 2.6.25 T{
763 PowerPC/PowerPC64 only
765 \fBswapcontext\fP(2) 2.6.3 T{
766 PowerPC/PowerPC64 only
768 .\" 529d235a0e190ded1d21ccc80a73e625ebcad09b
769 \fBswitch_endian\fP(2) 4.1 PowerPC64 only
773 \fBsymlinkat\fP(2) 2.6.16
775 \fBsync_file_range\fP(2) 2.6.17
776 \fBsync_file_range2\fP(2) 2.6.22
777 .\" PowerPC, ARM, tile
778 .\" First appeared on ARM, as arm_sync_file_range(), but later renamed
779 .\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32
780 \fBsyncfs\fP(2) 2.6.39
781 \fBsys_debug_setcontext\fP(2) 2.6.11 PowerPC only
782 \fBsyscall\fP(2) 1.0 T{
783 Still available on ARM OABI
789 .\" glibc interface is \fBklogctl\fP(3)
790 \fBsysmips\fP(2) 2.6.0 MIPS only
794 \fBtimer_create\fP(2) 2.6
795 \fBtimer_delete\fP(2) 2.6
796 \fBtimer_getoverrun\fP(2) 2.6
797 \fBtimer_gettime\fP(2) 2.6
798 \fBtimer_settime\fP(2) 2.6
799 .\" .\" b215e283992899650c4271e7385c79e26fb9a88e
800 .\" .\" 4d672e7ac79b5ec5cdc90e450823441e20464691
801 .\" \fBtimerfd\fP(2) 2.6.22 T{
802 .\" Old timerfd interface,
803 .\" removed in 2.6.25
805 \fBtimerfd_create\fP(2) 2.6.25
806 \fBtimerfd_gettime\fP(2) 2.6.25
807 \fBtimerfd_settime\fP(2) 2.6.25
809 \fBtkill\fP(2) 2.6; 2.4.22
810 \fBtruncate\fP(2) 1.0
811 \fBtruncate64\fP(2) 2.4
812 \fBugetrlimit\fP(2) 2.4
815 .\" sys_oldumount() -- __NR_umount
817 .\" sys_umount() -- __NR_umount2
820 \fBunlinkat\fP(2) 2.6.16
821 \fBunshare\fP(2) 2.6.16
824 \fBuserfaultfd\fP(2) 4.3
825 \fBusr26\fP(2) 2.4.8.1 ARM OABI only
826 \fBusr32\fP(2) 2.4.8.1 ARM OABI only
828 \fButimensat\fP(2) 2.6.22
830 \fButrap_install\fP(2) 2.2 SPARC64 only
831 .\" FIXME . document utrap_install()
832 .\" There's a man page for Solaris 5.11
835 \fBvm86old\fP(2) 1.0 T{
836 Was "vm86"; renamed in
839 \fBvm86\fP(2) 2.0.28; 2.2
840 \fBvmsplice\fP(2) 2.6.17
842 \fBwaitid\fP(2) 2.6.10
846 .\" 5a0015d62668e64c8b6e02e360fbbea121bfd5e6
847 \fBxtensa\fP(2) 2.6.13 Xtensa only
852 On many platforms, including x86-32, socket calls are all multiplexed
853 (via glibc wrapper functions) through
855 and similarly System\ V IPC calls are multiplexed through
858 Although slots are reserved for them in the system call table,
859 the following system calls are not implemented in the standard kernel:
860 .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386
861 .BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386
862 .BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386
863 .BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386
864 .BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386
865 .BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386
866 .BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386
867 .BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386
868 .BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386
869 .BR phys (2), \" Slot has been reused
870 .BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386
871 .BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386
872 .BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386
873 .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present
874 .\" on a couple of 2.6 architectures
875 .BR security (2), \" __NR_security is 223 on Linux 2.4/i386
876 .\" The security call is for future use.
877 .BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386
878 .BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha
879 .BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386
881 .BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386
883 .BR unimplemented (2)).
889 exist as library routines.
892 is in use since kernel 2.1.116 for
895 will never be implemented.
900 calls are for kernels patched to support STREAMS,
901 and may never be in the standard kernel.
904 .BR set_zone_reclaim (2),
905 added in Linux 2.6.13, and removed in 2.6.16;
906 this system call was never available to user space.
908 .SS System calls on removed ports
909 Some system calls only ever existed on Linux architectures that have
910 since been removed from the kernel:
912 AVR32 (port removed in Linux 4.12)
922 Blackfin (port removed in Linux 4.17)
926 .BR bfin_spinlock (2)
927 (added in Linux 2.6.22)
930 (added in Linux 2.6.22)
933 (added in Linux 2.6.22)
936 (added in Linux 2.6.22)
939 (added in Linux 2.6.22)
942 (added in Linux 2.6.22)
946 Metag (port removed in Linux 4.17)
950 .BR metag_get_tls (2)
953 .BR metag_set_fpu_flags (2)
956 .BR metag_set_tls (2)
959 .BR metag_setglobalbit (2)
964 Tile (port removed in Linux 4.17)
968 .BR cmpxchg_badaddr (2)
969 (added in Linux 2.6.36)
973 Roughly speaking, the code belonging to the system call
974 with number __NR_xxx defined in
975 .I /usr/include/asm/unistd.h
976 can be found in the Linux kernel source in the routine
978 There are many exceptions, however, mostly because
979 older system calls were superseded by newer ones,
980 and this has been treated somewhat unsystematically.
982 proprietary operating-system emulation,
983 such as sparc, sparc64, and alpha,
984 there are many additional system calls; mips64 also contains a full
985 set of 32-bit system calls.
987 Over time, changes to the interfaces of some system calls have been
989 One reason for such changes was the need to increase the size of
990 structures or scalar values passed to the system call.
991 Because of these changes, certain architectures
992 (notably, longstanding 32-bit architectures such as i386)
993 now have various groups of related system calls (e.g.,
997 which perform similar tasks, but which vary in
998 details such as the size of their arguments.
999 (As noted earlier, applications are generally unaware of this:
1000 the glibc wrapper functions do some work to ensure that the right
1001 system call is invoked, and that ABI compatibility is
1002 preserved for old binaries.)
1003 Examples of systems calls that exist in multiple versions are
1006 By now there are three different versions of
1018 with the last being the most current.
1019 .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195
1020 .\" The stat system calls deal with three different data structures,
1021 .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64
1022 A similar story applies for
1027 Similarly, the defines
1028 .IR __NR_oldolduname ,
1032 refer to the routines
1033 .IR sys_olduname (),
1036 .IR sys_newuname ().
1038 In Linux 2.0, a new version of
1040 appeared, with the old and the new kernel routines being named
1045 In Linux 2.4, a new version of
1047 appeared, with the old and the new kernel routines being named
1048 .IR sys_old_getrlimit ()
1050 .IR __NR_getrlimit )
1052 .IR sys_getrlimit ()
1054 .IR __NR_ugetrlimit ).
1056 Linux 2.4 increased the size of user and group IDs from 16 to 32 bits.
1057 .\" 64-bit off_t changes: ftruncate64, *stat64,
1058 .\" fcntl64 (because of the flock structure), getdents64, *statfs64
1059 To support this change, a range of system calls were added
1063 .BR getgroups32 (2),
1064 .BR setresuid32 (2)),
1065 superseding earlier calls of the same name without the
1068 Linux 2.4 added support for applications on 32-bit architectures
1069 to access large files (i.e., files for which the sizes and
1070 file offsets can't be represented in 32 bits.)
1071 To support this change, replacements were required for system calls
1072 that deal with file offsets and sizes.
1073 Thus the following system calls were added:
1079 and their analogs that work with file descriptors or
1081 These system calls supersede the older system calls
1082 which, except in the case of the "stat" calls,
1083 have the same name without the "64" suffix.
1085 On newer platforms that only have 64-bit file access and 32-bit UIDs/GIDs
1086 (e.g., alpha, ia64, s390x, x86-64), there is just a single version of
1087 the UID/GID and file access system calls.
1088 On platforms (typically, 32-bit platforms) where the *64 and *32 calls exist,
1089 the other versions are obsolete.
1093 calls were added in kernel 2.2 to support the addition
1094 of real-time signals (see
1096 These system calls supersede the older system calls of the same
1097 name without the "rt_" prefix.
1103 system calls use five or more arguments,
1104 which caused problems in the way
1105 argument passing on the i386 used to be set up.
1106 Thus, while other architectures have
1118 (routines that use a pointer to an
1119 argument block) instead.
1120 These days passing five arguments
1121 is not a problem any more, and there is a
1123 .\" (used by libc 6)
1124 that corresponds directly to
1128 s390x is the only 64-bit architecture that has
1131 .\" Two system call numbers,
1132 .\" .IR __NR__llseek
1134 .\" .IR __NR__sysctl
1135 .\" have an additional underscore absent in
1136 .\" .IR sys_llseek ()
1138 .\" .IR sys_sysctl ().
1140 .\" In kernel 2.1.81,
1144 .\" were swapped; that is,
1146 .\" was added with the semantics that were then current for
1148 .\" and the semantics of the latter call were changed to what
1152 .SS "Architecture-specific details: Alpha"
1155 returns a pair of GID and effective GID via registers
1156 \fBr0\fP and \fBr20\fP; it is provided
1158 \fBgetgid\fP(2) and \fBgetegid\fP(2).
1161 returns a pair of PID and parent PID via registers
1162 \fBr0\fP and \fBr20\fP; it is provided instead of
1163 \fBgetpid\fP(2) and \fBgetppid\fP(2).
1165 .BR old_adjtimex (2)
1166 is a variant of \fBadjtimex\fP(2) that uses \fIstruct timeval32\fP,
1167 for compatibility with OSF/1.
1170 returns a pair of GID and effective GID via registers
1171 \fBr0\fP and \fBr20\fP; it is provided instead of
1172 \fBgetuid\fP(2) and \fBgeteuid\fP(2).
1175 is used for configuring the Host Address Extension register on
1176 low-cost Alphas in order to access address space beyond first 27 bits.
1181 .BR unimplemented (2),