1syscalls(2) System Calls Manual syscalls(2)
2
3
4
6 syscalls - Linux system calls
7
9 Linux system calls.
10
12 The system call is the fundamental interface between an application and
13 the Linux kernel.
14
15 System calls and library wrapper functions
16 System calls are generally not invoked directly, but rather via wrapper
17 functions in glibc (or perhaps some other library). For details of di‐
18 rect invocation of a system call, see intro(2). Often, but not always,
19 the name of the wrapper function is the same as the name of the system
20 call that it invokes. For example, glibc contains a function chdir()
21 which invokes the underlying "chdir" system call.
22
23 Often the glibc wrapper function is quite thin, doing little work other
24 than copying arguments to the right registers before invoking the sys‐
25 tem call, and then setting errno appropriately after the system call
26 has returned. (These are the same steps that are performed by
27 syscall(2), which can be used to invoke system calls for which no wrap‐
28 per function is provided.) Note: system calls indicate a failure by
29 returning a negative error number to the caller on architectures with‐
30 out a separate error register/flag, as noted in syscall(2); when this
31 happens, the wrapper function negates the returned error number (to
32 make it positive), copies it to errno, and returns -1 to the caller of
33 the wrapper.
34
35 Sometimes, however, the wrapper function does some extra work before
36 invoking the system call. For example, nowadays there are (for reasons
37 described below) two related system calls, truncate(2) and trun‐
38 cate64(2), and the glibc truncate() wrapper function checks which of
39 those system calls are provided by the kernel and determines which
40 should be employed.
41
42 System call list
43 Below is a list of the Linux system calls. In the list, the Kernel
44 column indicates the kernel version for those system calls that were
45 new in Linux 2.2, or have appeared since that kernel version. Note the
46 following points:
47
48 • Where no kernel version is indicated, the system call appeared in
49 Linux 1.0 or earlier.
50
51 • Where a system call is marked "1.2" this means the system call prob‐
52 ably appeared in a Linux 1.1.x kernel version, and first appeared in
53 a stable kernel with 1.2. (Development of the 1.2 kernel was initi‐
54 ated from a branch of kernel 1.0.6 via the 1.1.x unstable kernel se‐
55 ries.)
56
57 • Where a system call is marked "2.0" this means the system call prob‐
58 ably appeared in a Linux 1.3.x kernel version, and first appeared in
59 a stable kernel with Linux 2.0. (Development of the Linux 2.0 ker‐
60 nel was initiated from a branch of Linux 1.2.x, somewhere around
61 Linux 1.2.10, via the Linux 1.3.x unstable kernel series.)
62
63 • Where a system call is marked "2.2" this means the system call prob‐
64 ably appeared in a Linux 2.1.x kernel version, and first appeared in
65 a stable kernel with Linux 2.2.0. (Development of the Linux 2.2
66 kernel was initiated from a branch of kernel Linux 2.0.21 via the
67 Linux 2.1.x unstable kernel series.)
68
69 • Where a system call is marked "2.4" this means the system call prob‐
70 ably appeared in a Linux 2.3.x kernel version, and first appeared in
71 a stable kernel with Linux 2.4.0. (Development of the Linux 2.4
72 kernel was initiated from a branch of Linux 2.2.8 via the Linux
73 2.3.x unstable kernel series.)
74
75 • Where a system call is marked "2.6" this means the system call prob‐
76 ably appeared in a Linux 2.5.x kernel version, and first appeared in
77 a stable kernel with Linux 2.6.0. (Development of Linux 2.6 was
78 initiated from a branch of Linux 2.4.15 via the Linux 2.5.x unstable
79 kernel series.)
80
81 • Starting with Linux 2.6.0, the development model changed, and new
82 system calls may appear in each Linux 2.6.x release. In this case,
83 the exact version number where the system call appeared is shown.
84 This convention continues with the Linux 3.x kernel series, which
85 followed on from Linux 2.6.39; and the Linux 4.x kernel series,
86 which followed on from Linux 3.19; and the Linux 5.x kernel series,
87 which followed on from Linux 4.20.
88
89 • In some cases, a system call was added to a stable kernel series af‐
90 ter it branched from the previous stable kernel series, and then
91 backported into the earlier stable kernel series. For example some
92 system calls that appeared in Linux 2.6.x were also backported into
93 a Linux 2.4.x release after Linux 2.4.15. When this is so, the ver‐
94 sion where the system call appeared in both of the major kernel se‐
95 ries is listed.
96
97 The list of system calls that are available as at Linux 5.14 (or in a
98 few cases only on older kernels) is as follows:
99
100 System call Kernel Notes
101 ──────────────────────────────────────────────────────────────────────
102
103 _llseek(2) 1.2
104 _newselect(2) 2.0
105 _sysctl(2) 2.0 Removed in 5.5
106 accept(2) 2.0 See notes on socketcall(2)
107 accept4(2) 2.6.28
108 access(2) 1.0
109 acct(2) 1.0
110 add_key(2) 2.6.10
111 adjtimex(2) 1.0
112 alarm(2) 1.0
113 alloc_hugepages(2) 2.5.36 Removed in 2.5.44
114 arc_gettls(2) 3.9 ARC only
115 arc_settls(2) 3.9 ARC only
116 arc_usr_cmpxchg(2) 4.9 ARC only
117 arch_prctl(2) 2.6 x86_64, x86 since 4.12
118 atomic_barrier(2) 2.6.34 m68k only
119 atomic_cmpxchg_32(2) 2.6.34 m68k only
120 bdflush(2) 1.2 Deprecated (does nothing)
121 since 2.6
122 bind(2) 2.0 See notes on socketcall(2)
123 bpf(2) 3.18
124 brk(2) 1.0
125 breakpoint(2) 2.2 ARM OABI only, defined with
126 __ARM_NR prefix
127 cacheflush(2) 1.2 Not on x86
128 capget(2) 2.2
129 capset(2) 2.2
130 chdir(2) 1.0
131 chmod(2) 1.0
132
133 chown(2) 2.2 See chown(2) for version
134 details
135 chown32(2) 2.4
136 chroot(2) 1.0
137 clock_adjtime(2) 2.6.39
138 clock_getres(2) 2.6
139 clock_gettime(2) 2.6
140 clock_nanosleep(2) 2.6
141 clock_settime(2) 2.6
142 clone2(2) 2.4 IA-64 only
143 clone(2) 1.0
144 clone3(2) 5.3
145 close(2) 1.0
146 close_range(2) 5.9
147 connect(2) 2.0 See notes on socketcall(2)
148 copy_file_range(2) 4.5
149 creat(2) 1.0
150 create_module(2) 1.0 Removed in 2.6
151 delete_module(2) 1.0
152 dup(2) 1.0
153 dup2(2) 1.0
154 dup3(2) 2.6.27
155 epoll_create(2) 2.6
156 epoll_create1(2) 2.6.27
157 epoll_ctl(2) 2.6
158 epoll_pwait(2) 2.6.19
159 epoll_pwait2(2) 5.11
160 epoll_wait(2) 2.6
161 eventfd(2) 2.6.22
162 eventfd2(2) 2.6.27
163 execv(2) 2.0 SPARC/SPARC64 only, for
164 compatibility with SunOS
165 execve(2) 1.0
166 execveat(2) 3.19
167 exit(2) 1.0
168 exit_group(2) 2.6
169 faccessat(2) 2.6.16
170 faccessat2(2) 5.8
171 fadvise64(2) 2.6
172 fadvise64_64(2) 2.6
173 fallocate(2) 2.6.23
174 fanotify_init(2) 2.6.37
175 fanotify_mark(2) 2.6.37
176 fchdir(2) 1.0
177 fchmod(2) 1.0
178 fchmodat(2) 2.6.16
179 fchown(2) 1.0
180 fchown32(2) 2.4
181 fchownat(2) 2.6.16
182 fcntl(2) 1.0
183 fcntl64(2) 2.4
184 fdatasync(2) 2.0
185 fgetxattr(2) 2.6; 2.4.18
186 finit_module(2) 3.8
187 flistxattr(2) 2.6; 2.4.18
188 flock(2) 2.0
189 fork(2) 1.0
190 free_hugepages(2) 2.5.36 Removed in 2.5.44
191 fremovexattr(2) 2.6; 2.4.18
192 fsconfig(2) 5.2
193 fsetxattr(2) 2.6; 2.4.18
194 fsmount(2) 5.2
195 fsopen(2) 5.2
196 fspick(2) 5.2
197 fstat(2) 1.0
198
199 fstat64(2) 2.4
200 fstatat64(2) 2.6.16
201 fstatfs(2) 1.0
202 fstatfs64(2) 2.6
203 fsync(2) 1.0
204 ftruncate(2) 1.0
205 ftruncate64(2) 2.4
206 futex(2) 2.6
207 futimesat(2) 2.6.16
208 get_kernel_syms(2) 1.0 Removed in 2.6
209 get_mempolicy(2) 2.6.6
210 get_robust_list(2) 2.6.17
211 get_thread_area(2) 2.6
212 get_tls(2) 4.15 ARM OABI only, has __ARM_NR
213 prefix
214 getcpu(2) 2.6.19
215 getcwd(2) 2.2
216 getdents(2) 2.0
217 getdents64(2) 2.4
218 getdomainname(2) 2.2 SPARC, SPARC64; available
219 as osf_getdomainname(2) on
220 Alpha since Linux 2.0
221 getdtablesize(2) 2.0 SPARC (removed in 2.6.26),
222 available on Alpha as
223 osf_getdtablesize(2)
224 getegid(2) 1.0
225 getegid32(2) 2.4
226 geteuid(2) 1.0
227 geteuid32(2) 2.4
228 getgid(2) 1.0
229 getgid32(2) 2.4
230 getgroups(2) 1.0
231 getgroups32(2) 2.4
232 gethostname(2) 2.0 Alpha, was available on
233 SPARC up to Linux 2.6.26
234 getitimer(2) 1.0
235 getpeername(2) 2.0 See notes on socketcall(2)
236 getpagesize(2) 2.0 Not on x86
237 getpgid(2) 1.0
238 getpgrp(2) 1.0
239 getpid(2) 1.0
240 getppid(2) 1.0
241 getpriority(2) 1.0
242 getrandom(2) 3.17
243 getresgid(2) 2.2
244 getresgid32(2) 2.4
245 getresuid(2) 2.2
246 getresuid32(2) 2.4
247 getrlimit(2) 1.0
248 getrusage(2) 1.0
249 getsid(2) 2.0
250 getsockname(2) 2.0 See notes on socketcall(2)
251 getsockopt(2) 2.0 See notes on socketcall(2)
252 gettid(2) 2.4.11
253 gettimeofday(2) 1.0
254 getuid(2) 1.0
255 getuid32(2) 2.4
256 getunwind(2) 2.4.8 IA-64 only; deprecated
257 getxattr(2) 2.6; 2.4.18
258 getxgid(2) 2.0 Alpha only; see NOTES
259 getxpid(2) 2.0 Alpha only; see NOTES
260 getxuid(2) 2.0 Alpha only; see NOTES
261 init_module(2) 1.0
262 inotify_add_watch(2) 2.6.13
263 inotify_init(2) 2.6.13
264
265 inotify_init1(2) 2.6.27
266 inotify_rm_watch(2) 2.6.13
267 io_cancel(2) 2.6
268 io_destroy(2) 2.6
269 io_getevents(2) 2.6
270 io_pgetevents(2) 4.18
271 io_setup(2) 2.6
272 io_submit(2) 2.6
273 io_uring_enter(2) 5.1
274 io_uring_register(2) 5.1
275 io_uring_setup(2) 5.1
276 ioctl(2) 1.0
277 ioperm(2) 1.0
278 iopl(2) 1.0
279 ioprio_get(2) 2.6.13
280 ioprio_set(2) 2.6.13
281 ipc(2) 1.0
282 kcmp(2) 3.5
283 kern_features(2) 3.7 SPARC64 only
284 kexec_file_load(2) 3.17
285 kexec_load(2) 2.6.13
286 keyctl(2) 2.6.10
287 kill(2) 1.0
288 landlock_add_rule(2) 5.13
289 landlock_create_ruleset(2) 5.13
290 landlock_restrict_self(2) 5.13
291 lchown(2) 1.0 See chown(2) for version
292 details
293 lchown32(2) 2.4
294 lgetxattr(2) 2.6; 2.4.18
295 link(2) 1.0
296 linkat(2) 2.6.16
297 listen(2) 2.0 See notes on socketcall(2)
298 listxattr(2) 2.6; 2.4.18
299 llistxattr(2) 2.6; 2.4.18
300 lookup_dcookie(2) 2.6
301 lremovexattr(2) 2.6; 2.4.18
302 lseek(2) 1.0
303 lsetxattr(2) 2.6; 2.4.18
304 lstat(2) 1.0
305 lstat64(2) 2.4
306 madvise(2) 2.4
307 mbind(2) 2.6.6
308 memory_ordering(2) 2.2 SPARC64 only
309 membarrier(2) 3.17
310 memfd_create(2) 3.17
311 memfd_secret(2) 5.14
312 migrate_pages(2) 2.6.16
313 mincore(2) 2.4
314 mkdir(2) 1.0
315 mkdirat(2) 2.6.16
316 mknod(2) 1.0
317 mknodat(2) 2.6.16
318 mlock(2) 2.0
319 mlock2(2) 4.4
320 mlockall(2) 2.0
321 mmap(2) 1.0
322 mmap2(2) 2.4
323 modify_ldt(2) 1.0
324 mount(2) 1.0
325 move_mount(2) 5.2
326 move_pages(2) 2.6.18
327 mprotect(2) 1.0
328 mq_getsetattr(2) 2.6.6
329 mq_notify(2) 2.6.6
330
331 mq_open(2) 2.6.6
332 mq_timedreceive(2) 2.6.6
333 mq_timedsend(2) 2.6.6
334 mq_unlink(2) 2.6.6
335 mremap(2) 2.0
336 msgctl(2) 2.0 See notes on ipc(2)
337 msgget(2) 2.0 See notes on ipc(2)
338 msgrcv(2) 2.0 See notes on ipc(2)
339 msgsnd(2) 2.0 See notes on ipc(2)
340 msync(2) 2.0
341 munlock(2) 2.0
342 munlockall(2) 2.0
343 munmap(2) 1.0
344 name_to_handle_at(2) 2.6.39
345 nanosleep(2) 2.0
346 newfstatat(2) 2.6.16 See stat(2)
347 nfsservctl(2) 2.2 Removed in 3.1
348 nice(2) 1.0
349 old_adjtimex(2) 2.0 Alpha only; see NOTES
350 old_getrlimit(2) 2.4 Old variant of getrlimit(2)
351 that used a different value
352 for RLIM_INFINITY
353 oldfstat(2) 1.0
354 oldlstat(2) 1.0
355 oldolduname(2) 1.0
356 oldstat(2) 1.0
357 oldumount(2) 2.4.116 Name of the old umount(2)
358 syscall on Alpha
359 olduname(2) 1.0
360 open(2) 1.0
361 open_by_handle_at(2) 2.6.39
362 open_tree(2) 5.2
363 openat(2) 2.6.16
364 openat2(2) 5.6
365 or1k_atomic(2) 3.1 OpenRISC 1000 only
366 pause(2) 1.0
367 pciconfig_iobase(2) 2.2.15; 2.4 Not on x86
368 pciconfig_read(2) 2.0.26; 2.2 Not on x86
369 pciconfig_write(2) 2.0.26; 2.2 Not on x86
370 perf_event_open(2) 2.6.31 Was perf_counter_open() in
371 2.6.31; renamed in 2.6.32
372 personality(2) 1.2
373 perfctr(2) 2.2 SPARC only; removed in
374 2.6.34
375 perfmonctl(2) 2.4 IA-64 only; removed in 5.10
376 pidfd_getfd(2) 5.6
377 pidfd_send_signal(2) 5.1
378 pidfd_open(2) 5.3
379 pipe(2) 1.0
380 pipe2(2) 2.6.27
381 pivot_root(2) 2.4
382 pkey_alloc(2) 4.8
383 pkey_free(2) 4.8
384 pkey_mprotect(2) 4.8
385 poll(2) 2.0.36; 2.2
386 ppoll(2) 2.6.16
387 prctl(2) 2.2
388 pread64(2) Added as "pread" in 2.2;
389 renamed "pread64" in 2.6
390 preadv(2) 2.6.30
391 preadv2(2) 4.6
392 prlimit64(2) 2.6.36
393 process_madvise(2) 5.10
394 process_vm_readv(2) 3.2
395 process_vm_writev(2) 3.2
396
397 pselect6(2) 2.6.16
398 ptrace(2) 1.0
399 pwrite64(2) Added as "pwrite" in 2.2;
400 renamed "pwrite64" in 2.6
401 pwritev(2) 2.6.30
402 pwritev2(2) 4.6
403 query_module(2) 2.2 Removed in 2.6
404 quotactl(2) 1.0
405 quotactl_fd(2) 5.14
406 read(2) 1.0
407 readahead(2) 2.4.13
408 readdir(2) 1.0
409 readlink(2) 1.0
410 readlinkat(2) 2.6.16
411 readv(2) 2.0
412 reboot(2) 1.0
413 recv(2) 2.0 See notes on socketcall(2)
414 recvfrom(2) 2.0 See notes on socketcall(2)
415 recvmsg(2) 2.0 See notes on socketcall(2)
416 recvmmsg(2) 2.6.33
417 remap_file_pages(2) 2.6 Deprecated since 3.16
418 removexattr(2) 2.6; 2.4.18
419 rename(2) 1.0
420 renameat(2) 2.6.16
421 renameat2(2) 3.15
422 request_key(2) 2.6.10
423 restart_syscall(2) 2.6
424 riscv_flush_icache(2) 4.15 RISC-V only
425 rmdir(2) 1.0
426 rseq(2) 4.18
427 rt_sigaction(2) 2.2
428 rt_sigpending(2) 2.2
429 rt_sigprocmask(2) 2.2
430 rt_sigqueueinfo(2) 2.2
431 rt_sigreturn(2) 2.2
432 rt_sigsuspend(2) 2.2
433 rt_sigtimedwait(2) 2.2
434 rt_tgsigqueueinfo(2) 2.6.31
435 rtas(2) 2.6.2 PowerPC/PowerPC64 only
436 s390_runtime_instr(2) 3.7 s390 only
437 s390_pci_mmio_read(2) 3.19 s390 only
438 s390_pci_mmio_write(2) 3.19 s390 only
439 s390_sthyi(2) 4.15 s390 only
440 s390_guarded_storage(2) 4.12 s390 only
441 sched_get_affinity(2) 2.6 Name of
442 sched_getaffinity(2) on
443 SPARC and SPARC64
444 sched_get_priority_max(2) 2.0
445 sched_get_priority_min(2) 2.0
446 sched_getaffinity(2) 2.6
447 sched_getattr(2) 3.14
448 sched_getparam(2) 2.0
449 sched_getscheduler(2) 2.0
450 sched_rr_get_interval(2) 2.0
451 sched_set_affinity(2) 2.6 Name of
452 sched_setaffinity(2) on
453 SPARC and SPARC64
454 sched_setaffinity(2) 2.6
455 sched_setattr(2) 3.14
456 sched_setparam(2) 2.0
457 sched_setscheduler(2) 2.0
458 sched_yield(2) 2.0
459 seccomp(2) 3.17
460 select(2) 1.0
461 semctl(2) 2.0 See notes on ipc(2)
462
463 semget(2) 2.0 See notes on ipc(2)
464 semop(2) 2.0 See notes on ipc(2)
465 semtimedop(2) 2.6; 2.4.22
466 send(2) 2.0 See notes on socketcall(2)
467 sendfile(2) 2.2
468 sendfile64(2) 2.6; 2.4.19
469 sendmmsg(2) 3.0
470 sendmsg(2) 2.0 See notes on socketcall(2)
471 sendto(2) 2.0 See notes on socketcall(2)
472 set_mempolicy(2) 2.6.6
473 set_robust_list(2) 2.6.17
474 set_thread_area(2) 2.6
475 set_tid_address(2) 2.6
476 set_tls(2) 2.6.11 ARM OABI/EABI only
477 (constant has __ARM_NR
478 prefix)
479 setdomainname(2) 1.0
480 setfsgid(2) 1.2
481 setfsgid32(2) 2.4
482 setfsuid(2) 1.2
483 setfsuid32(2) 2.4
484 setgid(2) 1.0
485 setgid32(2) 2.4
486 setgroups(2) 1.0
487 setgroups32(2) 2.4
488 sethae(2) 2.0 Alpha only; see NOTES
489 sethostname(2) 1.0
490 setitimer(2) 1.0
491 setns(2) 3.0
492 setpgid(2) 1.0
493 setpgrp(2) 2.0 Alternative name for
494 setpgid(2) on Alpha
495 setpriority(2) 1.0
496 setregid(2) 1.0
497 setregid32(2) 2.4
498 setresgid(2) 2.2
499 setresgid32(2) 2.4
500 setresuid(2) 2.2
501 setresuid32(2) 2.4
502 setreuid(2) 1.0
503 setreuid32(2) 2.4
504 setrlimit(2) 1.0
505 setsid(2) 1.0
506 setsockopt(2) 2.0 See notes on socketcall(2)
507 settimeofday(2) 1.0
508 setuid(2) 1.0
509 setuid32(2) 2.4
510 setup(2) 1.0 Removed in 2.2
511 setxattr(2) 2.6; 2.4.18
512 sgetmask(2) 1.0
513 shmat(2) 2.0 See notes on ipc(2)
514 shmctl(2) 2.0 See notes on ipc(2)
515 shmdt(2) 2.0 See notes on ipc(2)
516 shmget(2) 2.0 See notes on ipc(2)
517 shutdown(2) 2.0 See notes on socketcall(2)
518 sigaction(2) 1.0
519 sigaltstack(2) 2.2
520 signal(2) 1.0
521 signalfd(2) 2.6.22
522 signalfd4(2) 2.6.27
523 sigpending(2) 1.0
524 sigprocmask(2) 1.0
525 sigreturn(2) 1.0
526 sigsuspend(2) 1.0
527 socket(2) 2.0 See notes on socketcall(2)
528
529 socketcall(2) 1.0
530 socketpair(2) 2.0 See notes on socketcall(2)
531 spill(2) 2.6.13 Xtensa only
532 splice(2) 2.6.17
533 spu_create(2) 2.6.16 PowerPC/PowerPC64 only
534 spu_run(2) 2.6.16 PowerPC/PowerPC64 only
535 ssetmask(2) 1.0
536 stat(2) 1.0
537 stat64(2) 2.4
538 statfs(2) 1.0
539 statfs64(2) 2.6
540 statx(2) 4.11
541 stime(2) 1.0
542 subpage_prot(2) 2.6.25 PowerPC/PowerPC64 only
543 swapcontext(2) 2.6.3 PowerPC/PowerPC64 only
544 switch_endian(2) 4.1 PowerPC64 only
545 swapoff(2) 1.0
546 swapon(2) 1.0
547 symlink(2) 1.0
548 symlinkat(2) 2.6.16
549 sync(2) 1.0
550 sync_file_range(2) 2.6.17
551 sync_file_range2(2) 2.6.22
552 syncfs(2) 2.6.39
553 sys_debug_setcontext(2) 2.6.11 PowerPC only
554 syscall(2) 1.0 Still available on ARM OABI
555 and MIPS O32 ABI
556 sysfs(2) 1.2
557 sysinfo(2) 1.0
558 syslog(2) 1.0
559 sysmips(2) 2.6.0 MIPS only
560 tee(2) 2.6.17
561 tgkill(2) 2.6
562 time(2) 1.0
563 timer_create(2) 2.6
564 timer_delete(2) 2.6
565 timer_getoverrun(2) 2.6
566 timer_gettime(2) 2.6
567 timer_settime(2) 2.6
568 timerfd_create(2) 2.6.25
569 timerfd_gettime(2) 2.6.25
570 timerfd_settime(2) 2.6.25
571 times(2) 1.0
572 tkill(2) 2.6; 2.4.22
573 truncate(2) 1.0
574 truncate64(2) 2.4
575 ugetrlimit(2) 2.4
576 umask(2) 1.0
577 umount(2) 1.0
578 umount2(2) 2.2
579 uname(2) 1.0
580 unlink(2) 1.0
581 unlinkat(2) 2.6.16
582 unshare(2) 2.6.16
583 uselib(2) 1.0
584 ustat(2) 1.0
585 userfaultfd(2) 4.3
586 usr26(2) 2.4.8.1 ARM OABI only
587 usr32(2) 2.4.8.1 ARM OABI only
588 utime(2) 1.0
589 utimensat(2) 2.6.22
590 utimes(2) 2.2
591 utrap_install(2) 2.2 SPARC64 only
592 vfork(2) 2.2
593 vhangup(2) 1.0
594
595 vm86old(2) 1.0 Was "vm86"; renamed in
596 2.0.28/2.2
597 vm86(2) 2.0.28; 2.2
598 vmsplice(2) 2.6.17
599 wait4(2) 1.0
600 waitid(2) 2.6.10
601 waitpid(2) 1.0
602 write(2) 1.0
603 writev(2) 2.0
604 xtensa(2) 2.6.13 Xtensa only
605
606 On many platforms, including x86-32, socket calls are all multiplexed
607 (via glibc wrapper functions) through socketcall(2) and similarly Sys‐
608 tem V IPC calls are multiplexed through ipc(2).
609
610 Although slots are reserved for them in the system call table, the fol‐
611 lowing system calls are not implemented in the standard kernel:
612 afs_syscall(2), break(2), ftime(2), getpmsg(2), gtty(2), idle(2),
613 lock(2), madvise1(2), mpx(2), phys(2), prof(2), profil(2), putpmsg(2),
614 security(2), stty(2), tuxcall(2), ulimit(2), and vserver(2) (see also
615 unimplemented(2)). However, ftime(3), profil(3), and ulimit(3) exist
616 as library routines. The slot for phys(2) is in use since Linux
617 2.1.116 for umount(2); phys(2) will never be implemented. The
618 getpmsg(2) and putpmsg(2) calls are for kernels patched to support
619 STREAMS, and may never be in the standard kernel.
620
621 There was briefly set_zone_reclaim(2), added in Linux 2.6.13, and re‐
622 moved in Linux 2.6.16; this system call was never available to user
623 space.
624
625 System calls on removed ports
626 Some system calls only ever existed on Linux architectures that have
627 since been removed from the kernel:
628
629 AVR32 (port removed in Linux 4.12)
630 • pread(2)
631 • pwrite(2)
632
633 Blackfin (port removed in Linux 4.17)
634 • bfin_spinlock(2) (added in Linux 2.6.22)
635 • dma_memcpy(2) (added in Linux 2.6.22)
636 • pread(2) (added in Linux 2.6.22)
637 • pwrite(2) (added in Linux 2.6.22)
638 • sram_alloc(2) (added in Linux 2.6.22)
639 • sram_free(2) (added in Linux 2.6.22)
640
641 Metag (port removed in Linux 4.17)
642 • metag_get_tls(2) (add in Linux 3.9)
643 • metag_set_fpu_flags(2) (add in Linux 3.9)
644 • metag_set_tls(2) (add in Linux 3.9)
645 • metag_setglobalbit(2) (add in Linux 3.9)
646
647 Tile (port removed in Linux 4.17)
648 • cmpxchg_badaddr(2) (added in Linux 2.6.36)
649
651 Roughly speaking, the code belonging to the system call with number
652 __NR_xxx defined in /usr/include/asm/unistd.h can be found in the Linux
653 kernel source in the routine sys_xxx(). There are many exceptions,
654 however, mostly because older system calls were superseded by newer
655 ones, and this has been treated somewhat unsystematically. On plat‐
656 forms with proprietary operating-system emulation, such as sparc,
657 sparc64, and alpha, there are many additional system calls; mips64 also
658 contains a full set of 32-bit system calls.
659
660 Over time, changes to the interfaces of some system calls have been
661 necessary. One reason for such changes was the need to increase the
662 size of structures or scalar values passed to the system call. Because
663 of these changes, certain architectures (notably, longstanding 32-bit
664 architectures such as i386) now have various groups of related system
665 calls (e.g., truncate(2) and truncate64(2)) which perform similar
666 tasks, but which vary in details such as the size of their arguments.
667 (As noted earlier, applications are generally unaware of this: the
668 glibc wrapper functions do some work to ensure that the right system
669 call is invoked, and that ABI compatibility is preserved for old bina‐
670 ries.) Examples of systems calls that exist in multiple versions are
671 the following:
672
673 • By now there are three different versions of stat(2): sys_stat()
674 (slot __NR_oldstat), sys_newstat() (slot __NR_stat), and
675 sys_stat64() (slot __NR_stat64), with the last being the most cur‐
676 rent. A similar story applies for lstat(2) and fstat(2).
677
678 • Similarly, the defines __NR_oldolduname, __NR_olduname, and __NR_un‐
679 ame refer to the routines sys_olduname(), sys_uname(), and sys_newu‐
680 name().
681
682 • In Linux 2.0, a new version of vm86(2) appeared, with the old and
683 the new kernel routines being named sys_vm86old() and sys_vm86().
684
685 • In Linux 2.4, a new version of getrlimit(2) appeared, with the old
686 and the new kernel routines being named sys_old_getrlimit() (slot
687 __NR_getrlimit) and sys_getrlimit() (slot __NR_ugetrlimit).
688
689 • Linux 2.4 increased the size of user and group IDs from 16 to 32
690 bits. To support this change, a range of system calls were added
691 (e.g., chown32(2), getuid32(2), getgroups32(2), setresuid32(2)), su‐
692 perseding earlier calls of the same name without the "32" suffix.
693
694 • Linux 2.4 added support for applications on 32-bit architectures to
695 access large files (i.e., files for which the sizes and file offsets
696 can't be represented in 32 bits.) To support this change, replace‐
697 ments were required for system calls that deal with file offsets and
698 sizes. Thus the following system calls were added: fcntl64(2), get‐
699 dents64(2), stat64(2), statfs64(2), truncate64(2), and their analogs
700 that work with file descriptors or symbolic links. These system
701 calls supersede the older system calls which, except in the case of
702 the "stat" calls, have the same name without the "64" suffix.
703
704 On newer platforms that only have 64-bit file access and 32-bit
705 UIDs/GIDs (e.g., alpha, ia64, s390x, x86-64), there is just a single
706 version of the UID/GID and file access system calls. On platforms
707 (typically, 32-bit platforms) where the *64 and *32 calls exist, the
708 other versions are obsolete.
709
710 • The rt_sig* calls were added in Linux 2.2 to support the addition of
711 real-time signals (see signal(7)). These system calls supersede the
712 older system calls of the same name without the "rt_" prefix.
713
714 • The select(2) and mmap(2) system calls use five or more arguments,
715 which caused problems in the way argument passing on the i386 used
716 to be set up. Thus, while other architectures have sys_select() and
717 sys_mmap() corresponding to __NR_select and __NR_mmap, on i386 one
718 finds old_select() and old_mmap() (routines that use a pointer to an
719 argument block) instead. These days passing five arguments is not a
720 problem any more, and there is a __NR__newselect that corresponds
721 directly to sys_select() and similarly __NR_mmap2. s390x is the on‐
722 ly 64-bit architecture that has old_mmap().
723
724 Architecture-specific details: Alpha
725 getxgid(2)
726 returns a pair of GID and effective GID via registers r0 and
727 r20; it is provided instead of getgid(2) and getegid(2).
728
729 getxpid(2)
730 returns a pair of PID and parent PID via registers r0 and r20;
731 it is provided instead of getpid(2) and getppid(2).
732
733 old_adjtimex(2)
734 is a variant of adjtimex(2) that uses struct timeval32, for com‐
735 patibility with OSF/1.
736
737 getxuid(2)
738 returns a pair of GID and effective GID via registers r0 and
739 r20; it is provided instead of getuid(2) and geteuid(2).
740
741 sethae(2)
742 is used for configuring the Host Address Extension register on
743 low-cost Alphas in order to access address space beyond first 27
744 bits.
745
747 ausyscall(1), intro(2), syscall(2), unimplemented(2), errno(3),
748 libc(7), vdso(7)
749
750
751
752Linux man-pages 6.04 2023-02-05 syscalls(2)