1SYSCALLS(2)                Linux Programmer's Manual               SYSCALLS(2)
2
3
4

NAME

6       syscalls - Linux system calls
7

SYNOPSIS

9       Linux system calls.
10

DESCRIPTION

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
18       direct invocation of a system  call,  see  intro(2).   Often,  but  not
19       always, the name of the wrapper function is the same as the name of the
20       system call that it invokes.  For example, glibc  contains  a  function
21       chdir() 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          kernel 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  1.1.x kernel version, and first appeared in a
53          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
55          series.)
56
57       *  Where a system call is marked "2.0" this means the system call prob‐
58          ably  appeared  in  a  1.3.x kernel version, and first appeared in a
59          stable kernel with 2.0.  (Development of the 2.0 kernel  was  initi‐
60          ated from a branch of kernel 1.2.x, somewhere around 1.2.10, via the
61          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  2.1.x kernel version, and first appeared in a
65          stable kernel with 2.2.0.  (Development of the 2.2 kernel was initi‐
66          ated  from  a  branch of kernel 2.0.21 via the 2.1.x unstable kernel
67          series.)
68
69       *  Where a system call is marked "2.4" this means the system call prob‐
70          ably  appeared  in  a  2.3.x kernel version, and first appeared in a
71          stable kernel with 2.4.0.  (Development of the 2.4 kernel was initi‐
72          ated  from  a  branch  of kernel 2.2.8 via the 2.3.x unstable kernel
73          series.)
74
75       *  Where a system call is marked "2.6" this means the system call prob‐
76          ably  appeared  in  a  2.5.x kernel version, and first appeared in a
77          stable kernel with 2.6.0.  (Development of kernel 2.6 was  initiated
78          from  a  branch  of  kernel  2.4.15  via  the  2.5.x unstable kernel
79          series.)
80
81       *  Starting with kernel 2.6.0, the development model changed,  and  new
82          system  calls  may  appear in each 2.6.x release.  In this case, the
83          exact version number where the system call appeared is shown.   This
84          convention  continues  with the 3.x kernel series, which followed on
85          from kernel 2.6.39; and the 4.x kernel  series,  which  followed  on
86          from  kernel 3.19; and the 5.x kernel series, which followed on from
87          kernel 4.20.
88
89       *  In some cases, a system call was added to  a  stable  kernel  series
90          after  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  2.6.x were also backported into a
93          2.4.x release after 2.4.15.  When this is so, the version where  the
94          system call appeared in both of the major kernel series is listed.
95
96       The  list of system calls that are available as at kernel 4.19 (or in a
97       few cases only on older kernels) is as follows:
98
99       System call                Kernel        Notes
100       ───────────────────────────────────────────────────────────────────────
101
102       _llseek(2)                 1.2
103       _newselect(2)              2.0
104       _sysctl(2)                 2.0
105       accept(2)                  2.0           See notes on socketcall(2)
106       accept4(2)                 2.6.28
107       access(2)                  1.0
108       acct(2)                    1.0
109       add_key(2)                 2.6.10
110       adjtimex(2)                1.0
111       alarm(2)                   1.0
112       alloc_hugepages(2)         2.5.36        Removed in 2.5.44
113       arc_gettls(2)              3.9           ARC only
114       arc_settls(2)              3.9           ARC only
115       arc_usr_cmpxchg(2)         4.9           ARC only
116       arch_prctl(2)              2.6           x86_64, x86 since 4.12
117       atomic_barrier(2)          2.6.34        m68k only
118       atomic_cmpxchg_32(2)       2.6.34        m68k only
119       bdflush(2)                 1.2           Deprecated (does nothing)
120                                                since 2.6
121       bfin_spinlock(2)           2.6.22        Blackfin only (port removed
122                                                in Linux 4.17)
123       bind(2)                    2.0           See notes on socketcall(2)
124       bpf(2)                     3.18
125       brk(2)                     1.0
126       breakpoint(2)              2.2           ARM OABI only, defined with
127                                                __ARM_NR prefix
128       cacheflush(2)              1.2           Not on x86
129       capget(2)                  2.2
130       capset(2)                  2.2
131       chdir(2)                   1.0
132
133       chmod(2)                   1.0
134       chown(2)                   2.2           See chown(2) for
135                                                version details
136       chown32(2)                 2.4
137       chroot(2)                  1.0
138       clock_adjtime(2)           2.6.39
139       clock_getres(2)            2.6
140       clock_gettime(2)           2.6
141       clock_nanosleep(2)         2.6
142       clock_settime(2)           2.6
143       clone2(2)                  2.4           IA-64 only
144       clone(2)                   1.0
145       clone3(2)                  5.3
146       close(2)                   1.0
147       cmpxchg_badaddr(2)         2.6.36        Tile only (port removed
148                                                in Linux 4.17)
149       connect(2)                 2.0           See notes on socketcall(2)
150       copy_file_range(2)         4.5
151       creat(2)                   1.0
152       create_module(2)           1.0           Removed in 2.6
153       delete_module(2)           1.0
154       dma_memcpy(2)              2.6.22        Blackfin only (port removed
155                                                in Linux 4.17)
156       dup(2)                     1.0
157       dup2(2)                    1.0
158       dup3(2)                    2.6.27
159       epoll_create(2)            2.6
160       epoll_create1(2)           2.6.27
161       epoll_ctl(2)               2.6
162       epoll_pwait(2)             2.6.19
163       epoll_wait(2)              2.6
164       eventfd(2)                 2.6.22
165       eventfd2(2)                2.6.27
166       execv(2)                   2.0           SPARC/SPARC64 only, for
167                                                compatibility with SunOS
168       execve(2)                  1.0
169       execveat(2)                3.19
170       exit(2)                    1.0
171       exit_group(2)              2.6
172       faccessat(2)               2.6.16
173       fadvise64(2)               2.6
174       fadvise64_64(2)            2.6
175       fallocate(2)               2.6.23
176       fanotify_init(2)           2.6.37
177       fanotify_mark(2)           2.6.37
178       fchdir(2)                  1.0
179       fchmod(2)                  1.0
180       fchmodat(2)                2.6.16
181       fchown(2)                  1.0
182       fchown32(2)                2.4
183       fchownat(2)                2.6.16
184       fcntl(2)                   1.0
185       fcntl64(2)                 2.4
186       fdatasync(2)               2.0
187       fgetxattr(2)               2.6; 2.4.18
188       finit_module(2)            3.8
189       flistxattr(2)              2.6; 2.4.18
190       flock(2)                   2.0
191       fork(2)                    1.0
192       free_hugepages(2)          2.5.36        Removed in 2.5.44
193       fremovexattr(2)            2.6; 2.4.18
194       fsconfig(2)                5.2
195       fsetxattr(2)               2.6; 2.4.18
196       fsmount(2)                 5.2
197       fsopen(2)                  5.2
198
199       fspick(2)                  5.2
200       fstat(2)                   1.0
201       fstat64(2)                 2.4
202       fstatat64(2)               2.6.16
203       fstatfs(2)                 1.0
204       fstatfs64(2)               2.6
205       fsync(2)                   1.0
206       ftruncate(2)               1.0
207       ftruncate64(2)             2.4
208       futex(2)                   2.6
209       futimesat(2)               2.6.16
210       get_kernel_syms(2)         1.0           Removed in 2.6
211       get_mempolicy(2)           2.6.6
212       get_robust_list(2)         2.6.17
213       get_thread_area(2)         2.6
214       get_tls(2)                 4.15          ARM OABI only, has
215                                                __ARM_NR prefix
216       getcpu(2)                  2.6.19
217       getcwd(2)                  2.2
218       getdents(2)                2.0
219       getdents64(2)              2.4
220       getdomainname(2)           2.2           SPARC, SPARC64; available
221                                                as osf_getdomainname(2)
222                                                on Alpha since Linux 2.0
223       getdtablesize(2)           2.0           SPARC (removed in 2.6.26),
224                                                available on Alpha as
225                                                osf_getdtablesize(2)
226       getegid(2)                 1.0
227       getegid32(2)               2.4
228       geteuid(2)                 1.0
229       geteuid32(2)               2.4
230       getgid(2)                  1.0
231       getgid32(2)                2.4
232       getgroups(2)               1.0
233       getgroups32(2)             2.4
234       gethostname(2)             2.0           Alpha, was available on
235                                                SPARC up to Linux 2.6.26
236       getitimer(2)               1.0
237       getpeername(2)             2.0           See notes on socketcall(2)
238       getpagesize(2)             2.0           Not on x86
239       getpgid(2)                 1.0
240       getpgrp(2)                 1.0
241       getpid(2)                  1.0
242       getppid(2)                 1.0
243       getpriority(2)             1.0
244       getrandom(2)               3.17
245       getresgid(2)               2.2
246       getresgid32(2)             2.4
247       getresuid(2)               2.2
248       getresuid32(2)             2.4
249       getrlimit(2)               1.0
250       getrusage(2)               1.0
251       getsid(2)                  2.0
252       getsockname(2)             2.0           See notes on socketcall(2)
253       getsockopt(2)              2.0           See notes on socketcall(2)
254       gettid(2)                  2.4.11
255       gettimeofday(2)            1.0
256       getuid(2)                  1.0
257       getuid32(2)                2.4
258       getunwind(2)               2.4.8         IA-64 only; deprecated
259       getxattr(2)                2.6; 2.4.18
260       getxgid(2)                 2.0           Alpha only; see NOTES
261       getxpid(2)                 2.0           Alpha only; see NOTES
262       getxuid(2)                 2.0           Alpha only; see NOTES
263       init_module(2)             1.0
264
265       inotify_add_watch(2)       2.6.13
266       inotify_init(2)            2.6.13
267       inotify_init1(2)           2.6.27
268       inotify_rm_watch(2)        2.6.13
269       io_cancel(2)               2.6
270       io_destroy(2)              2.6
271       io_getevents(2)            2.6
272       io_pgetevents(2)           4.18
273       io_setup(2)                2.6
274       io_submit(2)               2.6
275       io_uring_enter(2)          5.1
276       io_uring_register(2)       5.1
277       io_uring_setup(2)          5.1
278       ioctl(2)                   1.0
279       ioperm(2)                  1.0
280       iopl(2)                    1.0
281       ioprio_get(2)              2.6.13
282       ioprio_set(2)              2.6.13
283       ipc(2)                     1.0
284       kcmp(2)                    3.5
285       kern_features(2)           3.7           SPARC64 only
286       kexec_file_load(2)         3.17
287       kexec_load(2)              2.6.13
288       keyctl(2)                  2.6.10
289       kill(2)                    1.0
290       lchown(2)                  1.0           See chown(2) for
291                                                version details
292       lchown32(2)                2.4
293       lgetxattr(2)               2.6; 2.4.18
294       link(2)                    1.0
295       linkat(2)                  2.6.16
296       listen(2)                  2.0           See notes on socketcall(2)
297       listxattr(2)               2.6; 2.4.18
298       llistxattr(2)              2.6; 2.4.18
299       lookup_dcookie(2)          2.6
300       lremovexattr(2)            2.6; 2.4.18
301       lseek(2)                   1.0
302       lsetxattr(2)               2.6; 2.4.18
303       lstat(2)                   1.0
304       lstat64(2)                 2.4
305       madvise(2)                 2.4
306       mbind(2)                   2.6.6
307       memory_ordering(2)         2.2           SPARC64 only
308       metag_get_tls(2)           3.9           Metag only (port removed
309                                                in Linux 4.17)
310       metag_set_fpu_flags(2)     3.9           Metag only (port removed
311                                                in Linux 4.17)
312       metag_set_tls(2)           3.9           Metag only (port removed
313                                                in Linux 4.17)
314       metag_setglobalbit(2)      3.9           Metag only (port removed
315                                                in Linux 4.17)
316       membarrier(2)              3.17
317       memfd_create(2)            3.17
318       migrate_pages(2)           2.6.16
319       mincore(2)                 2.4
320       mkdir(2)                   1.0
321       mkdirat(2)                 2.6.16
322       mknod(2)                   1.0
323       mknodat(2)                 2.6.16
324       mlock(2)                   2.0
325       mlock2(2)                  4.4
326       mlockall(2)                2.0
327       mmap(2)                    1.0
328       mmap2(2)                   2.4
329       modify_ldt(2)              1.0
330
331       mount(2)                   1.0
332       move_mount(2)              5.2
333       move_pages(2)              2.6.18
334       mprotect(2)                1.0
335       mq_getsetattr(2)           2.6.6
336       mq_notify(2)               2.6.6
337       mq_open(2)                 2.6.6
338       mq_timedreceive(2)         2.6.6
339       mq_timedsend(2)            2.6.6
340       mq_unlink(2)               2.6.6
341       mremap(2)                  2.0
342       msgctl(2)                  2.0           See notes on ipc(2)
343       msgget(2)                  2.0           See notes on ipc(2)
344       msgrcv(2)                  2.0           See notes on ipc(2)
345       msgsnd(2)                  2.0           See notes on ipc(2)
346       msync(2)                   2.0
347       munlock(2)                 2.0
348       munlockall(2)              2.0
349       munmap(2)                  1.0
350       name_to_handle_at(2)       2.6.39
351       nanosleep(2)               2.0
352       newfstatat(2)              2.6.16        See stat(2)
353       nfsservctl(2)              2.2           Removed in 3.1
354       nice(2)                    1.0
355       old_adjtimex(2)            2.0           Alpha only; see NOTES
356       old_getrlimit(2)           2.4           Old variant of getrlimit(2)
357                                                that used a different value
358                                                for RLIM_INFINITY
359       oldfstat(2)                1.0
360       oldlstat(2)                1.0
361       oldolduname(2)             1.0
362       oldstat(2)                 1.0
363       oldumount(2)               2.4.116       Name of the old umount(2)
364                                                syscall on Alpha
365       olduname(2)                1.0
366       open(2)                    1.0
367       open_by_handle_at(2)       2.6.39
368       open_tree(2)               5.2
369       openat(2)                  2.6.16
370       openat2(2)                 5.6
371       or1k_atomic(2)             3.1           OpenRISC 1000 only
372       pause(2)                   1.0
373       pciconfig_iobase(2)        2.2.15; 2.4   Not on x86
374       pciconfig_read(2)          2.0.26; 2.2   Not on x86
375       pciconfig_write(2)         2.0.26; 2.2   Not on x86
376       perf_event_open(2)         2.6.31        Was perf_counter_open() in
377                                                2.6.31; renamed in 2.6.32
378       personality(2)             1.2
379       perfctr(2)                 2.2           SPARC only; removed in 2.6.34
380       perfmonctl(2)              2.4           IA-64 only
381       pidfd_getfd(2)             5.6
382       pidfd_send_signal(2)       5.1
383       pidfd_open(2)              5.3
384       pipe(2)                    1.0
385       pipe2(2)                   2.6.27
386       pivot_root(2)              2.4
387       pkey_alloc(2)              4.8
388       pkey_free(2)               4.8
389       pkey_mprotect(2)           4.8
390       poll(2)                    2.0.36; 2.2
391       ppoll(2)                   2.6.16
392       prctl(2)                   2.2
393
394
395
396
397       pread(2)                                 Used for pread64(2) on AVR32
398                                                (port removed in Linux 4.12)
399                                                and Blackfin (port removed
400                                                in Linux 4.17)
401       pread64(2)                               Added as "pread" in 2.2;
402                                                renamed "pread64" in 2.6
403       preadv(2)                  2.6.30
404       preadv2(2)                 4.6
405       prlimit64(2)               2.6.36
406       process_vm_readv(2)        3.2
407       process_vm_writev(2)       3.2
408       pselect6(2)                2.6.16
409       ptrace(2)                  1.0
410       pwrite(2)                                Used for pwrite64(2)
411                                                on AVR32 (port removed
412                                                in Linux 4.12) and Blackfin
413                                                (port removed in Linux 4.17)
414       pwrite64(2)                              Added as "pwrite" in 2.2;
415                                                renamed "pwrite64" in 2.6
416       pwritev(2)                 2.6.30
417       pwritev2(2)                4.6
418       query_module(2)            2.2           Removed in 2.6
419       quotactl(2)                1.0
420       read(2)                    1.0
421       readahead(2)               2.4.13
422       readdir(2)                 1.0
423       readlink(2)                1.0
424       readlinkat(2)              2.6.16
425       readv(2)                   2.0
426       reboot(2)                  1.0
427       recv(2)                    2.0           See notes on socketcall(2)
428       recvfrom(2)                2.0           See notes on socketcall(2)
429       recvmsg(2)                 2.0           See notes on socketcall(2)
430       recvmmsg(2)                2.6.33
431       remap_file_pages(2)        2.6           Deprecated since 3.16
432       removexattr(2)             2.6; 2.4.18
433       rename(2)                  1.0
434       renameat(2)                2.6.16
435       renameat2(2)               3.15
436       request_key(2)             2.6.10
437       restart_syscall(2)         2.6
438       riscv_flush_icache(2)      4.15          RISC-V only
439       rmdir(2)                   1.0
440       rseq(2)                    4.18
441       rt_sigaction(2)            2.2
442       rt_sigpending(2)           2.2
443       rt_sigprocmask(2)          2.2
444       rt_sigqueueinfo(2)         2.2
445       rt_sigreturn(2)            2.2
446       rt_sigsuspend(2)           2.2
447       rt_sigtimedwait(2)         2.2
448       rt_tgsigqueueinfo(2)       2.6.31
449       rtas(2)                    2.6.2         PowerPC/PowerPC64 only
450       s390_runtime_instr(2)      3.7           s390 only
451       s390_pci_mmio_read(2)      3.19          s390 only
452       s390_pci_mmio_write(2)     3.19          s390 only
453       s390_sthyi(2)              4.15          s390 only
454       s390_guarded_storage(2)    4.12          s390 only
455       sched_get_affinity(2)      2.6           Name of sched_getaffinity(2)
456                                                on SPARC and SPARC64
457       sched_get_priority_max(2)  2.0
458       sched_get_priority_min(2)  2.0
459       sched_getaffinity(2)       2.6
460       sched_getattr(2)           3.14
461       sched_getparam(2)          2.0
462
463       sched_getscheduler(2)      2.0
464       sched_rr_get_interval(2)   2.0
465       sched_set_affinity(2)      2.6           Name of sched_setaffinity(2)
466                                                on SPARC and SPARC64
467       sched_setaffinity(2)       2.6
468       sched_setattr(2)           3.14
469       sched_setparam(2)          2.0
470       sched_setscheduler(2)      2.0
471       sched_yield(2)             2.0
472       seccomp(2)                 3.17
473       select(2)                  1.0
474       semctl(2)                  2.0           See notes on ipc(2)
475       semget(2)                  2.0           See notes on ipc(2)
476       semop(2)                   2.0           See notes on ipc(2)
477       semtimedop(2)              2.6; 2.4.22
478       send(2)                    2.0           See notes on socketcall(2)
479       sendfile(2)                2.2
480       sendfile64(2)              2.6; 2.4.19
481       sendmmsg(2)                3.0
482       sendmsg(2)                 2.0           See notes on socketcall(2)
483       sendto(2)                  2.0           See notes on socketcall(2)
484       set_mempolicy(2)           2.6.6
485       set_robust_list(2)         2.6.17
486       set_thread_area(2)         2.6
487       set_tid_address(2)         2.6
488       set_tls(2)                 2.6.11        ARM OABI/EABI only (constant
489                                                has __ARM_NR prefix)
490       setdomainname(2)           1.0
491       setfsgid(2)                1.2
492       setfsgid32(2)              2.4
493       setfsuid(2)                1.2
494       setfsuid32(2)              2.4
495       setgid(2)                  1.0
496       setgid32(2)                2.4
497       setgroups(2)               1.0
498       setgroups32(2)             2.4
499       sethae(2)                  2.0           Alpha only; see NOTES
500       sethostname(2)             1.0
501       setitimer(2)               1.0
502       setns(2)                   3.0
503       setpgid(2)                 1.0
504       setpgrp(2)                 2.0           Alternative name for
505                                                setpgid(2) on Alpha
506       setpriority(2)             1.0
507       setregid(2)                1.0
508       setregid32(2)              2.4
509       setresgid(2)               2.2
510       setresgid32(2)             2.4
511       setresuid(2)               2.2
512       setresuid32(2)             2.4
513       setreuid(2)                1.0
514       setreuid32(2)              2.4
515       setrlimit(2)               1.0
516       setsid(2)                  1.0
517       setsockopt(2)              2.0           See notes on socketcall(2)
518       settimeofday(2)            1.0
519       setuid(2)                  1.0
520       setuid32(2)                2.4
521       setup(2)                   1.0           Removed in 2.2
522       setxattr(2)                2.6; 2.4.18
523       sgetmask(2)                1.0
524       shmat(2)                   2.0           See notes on ipc(2)
525       shmctl(2)                  2.0           See notes on ipc(2)
526       shmdt(2)                   2.0           See notes on ipc(2)
527       shmget(2)                  2.0           See notes on ipc(2)
528
529       shutdown(2)                2.0           See notes on socketcall(2)
530       sigaction(2)               1.0
531       sigaltstack(2)             2.2
532       signal(2)                  1.0
533       signalfd(2)                2.6.22
534       signalfd4(2)               2.6.27
535       sigpending(2)              1.0
536       sigprocmask(2)             1.0
537       sigreturn(2)               1.0
538       sigsuspend(2)              1.0
539       socket(2)                  2.0           See notes on socketcall(2)
540       socketcall(2)              1.0
541       socketpair(2)              2.0           See notes on socketcall(2)
542       spill(2)                   2.6.13        Xtensa only
543       splice(2)                  2.6.17
544       spu_create(2)              2.6.16        PowerPC/PowerPC64 only
545       spu_run(2)                 2.6.16        PowerPC/PowerPC64 only
546       sram_alloc(2)              2.6.22        Blackfin (port removed
547                                                in Linux 4.17)
548       sram_free(2)               2.6.22        Blackfin (port removed
549                                                in Linux 4.17)
550       ssetmask(2)                1.0
551       stat(2)                    1.0
552       stat64(2)                  2.4
553       statfs(2)                  1.0
554       statfs64(2)                2.6
555       statx(2)                   4.11
556       stime(2)                   1.0
557       subpage_prot(2)            2.6.25        PowerPC/PowerPC64 only
558       swapcontext(2)             2.6.3         PowerPC/PowerPC64 only
559       switch_endian(2)           4.1           PowerPC64 only
560       swapcontext(2)             2.6.3         PowerPC only
561       swapoff(2)                 1.0
562       swapon(2)                  1.0
563       symlink(2)                 1.0
564       symlinkat(2)               2.6.16
565       sync(2)                    1.0
566       sync_file_range(2)         2.6.17
567       sync_file_range2(2)        2.6.22
568       syncfs(2)                  2.6.39
569       sys_debug_setcontext(2)    2.6.11        PowerPC only
570       syscall(2)                 1.0           Still available on ARM OABI
571                                                and MIPS O32 ABI
572       sysfs(2)                   1.2
573       sysinfo(2)                 1.0
574       syslog(2)                  1.0
575       sysmips(2)                 2.6.0         MIPS only
576       tee(2)                     2.6.17
577       tgkill(2)                  2.6
578       time(2)                    1.0
579       timer_create(2)            2.6
580       timer_delete(2)            2.6
581       timer_getoverrun(2)        2.6
582       timer_gettime(2)           2.6
583       timer_settime(2)           2.6
584       timerfd_create(2)          2.6.25
585       timerfd_gettime(2)         2.6.25
586       timerfd_settime(2)         2.6.25
587       times(2)                   1.0
588       tkill(2)                   2.6; 2.4.22
589       truncate(2)                1.0
590       truncate64(2)              2.4
591       ugetrlimit(2)              2.4
592       umask(2)                   1.0
593       umount(2)                  1.0
594
595       umount2(2)                 2.2
596       uname(2)                   1.0
597       unlink(2)                  1.0
598       unlinkat(2)                2.6.16
599       unshare(2)                 2.6.16
600       uselib(2)                  1.0
601       ustat(2)                   1.0
602       userfaultfd(2)             4.3
603       usr26(2)                   2.4.8.1       ARM OABI only
604       usr32(2)                   2.4.8.1       ARM OABI only
605       utime(2)                   1.0
606       utimensat(2)               2.6.22
607       utimes(2)                  2.2
608       utrap_install(2)           2.2           SPARC64 only
609       vfork(2)                   2.2
610       vhangup(2)                 1.0
611       vm86old(2)                 1.0           Was "vm86"; renamed in
612                                                2.0.28/2.2
613       vm86(2)                    2.0.28; 2.2
614       vmsplice(2)                2.6.17
615       wait4(2)                   1.0
616       waitid(2)                  2.6.10
617       waitpid(2)                 1.0
618       write(2)                   1.0
619       writev(2)                  2.0
620       xtensa(2)                  2.6.13        Xtensa only
621
622       On many platforms, including x86-32, socket calls are  all  multiplexed
623       (via  glibc wrapper functions) through socketcall(2) and similarly Sys‐
624       tem V IPC calls are multiplexed through ipc(2).
625
626       Although slots are reserved for them in the system call table, the fol‐
627       lowing  system  calls  are  not  implemented  in  the  standard kernel:
628       afs_syscall(2),  break(2),  ftime(2),  getpmsg(2),  gtty(2),   idle(2),
629       lock(2),  madvise1(2), mpx(2), phys(2), prof(2), profil(2), putpmsg(2),
630       security(2), stty(2), tuxcall(2), ulimit(2), and vserver(2)  (see  also
631       unimplemented(2)).   However,  ftime(3), profil(3), and ulimit(3) exist
632       as library routines.  The slot for  phys(2)  is  in  use  since  kernel
633       2.1.116   for  umount(2);  phys(2)  will  never  be  implemented.   The
634       getpmsg(2) and putpmsg(2) calls are  for  kernels  patched  to  support
635       STREAMS, and may never be in the standard kernel.
636
637       There  was  briefly  set_zone_reclaim(2),  added  in  Linux 2.6.13, and
638       removed in 2.6.16; this system call was never available to user space.
639

NOTES

641       Roughly speaking, the code belonging to the  system  call  with  number
642       __NR_xxx defined in /usr/include/asm/unistd.h can be found in the Linux
643       kernel source in the routine sys_xxx().   There  are  many  exceptions,
644       however,  mostly  because  older  system calls were superseded by newer
645       ones, and this has been treated somewhat  unsystematically.   On  plat‐
646       forms  with  proprietary  operating-system  emulation,  such  as sparc,
647       sparc64, and alpha, there are many additional system calls; mips64 also
648       contains a full set of 32-bit system calls.
649
650       Over  time,  changes  to  the interfaces of some system calls have been
651       necessary.  One reason for such changes was the need  to  increase  the
652       size of structures or scalar values passed to the system call.  Because
653       of these changes, certain architectures (notably,  longstanding  32-bit
654       architectures  such  as i386) now have various groups of related system
655       calls (e.g.,  truncate(2)  and  truncate64(2))  which  perform  similar
656       tasks,  but  which vary in details such as the size of their arguments.
657       (As noted earlier, applications are  generally  unaware  of  this:  the
658       glibc  wrapper  functions  do some work to ensure that the right system
659       call is invoked, and that ABI compatibility is preserved for old  bina‐
660       ries.)   Examples  of systems calls that exist in multiple versions are
661       the following:
662
663       *  By now there are three different  versions  of  stat(2):  sys_stat()
664          (slot    __NR_oldstat),    sys_newstat()   (slot   __NR_stat),   and
665          sys_stat64() (slot __NR_stat64), with the last being the  most  cur‐
666          rent.  A similar story applies for lstat(2) and fstat(2).
667
668       *  Similarly,   the   defines   __NR_oldolduname,   __NR_olduname,  and
669          __NR_uname refer to the  routines  sys_olduname(),  sys_uname()  and
670          sys_newuname().
671
672       *  In  Linux  2.0,  a new version of vm86(2) appeared, with the old and
673          the new kernel routines being named sys_vm86old() and sys_vm86().
674
675       *  In Linux 2.4, a new version of getrlimit(2) appeared, with  the  old
676          and  the  new  kernel routines being named sys_old_getrlimit() (slot
677          __NR_getrlimit) and sys_getrlimit() (slot __NR_ugetrlimit).
678
679       *  Linux 2.4 increased the size of user and group IDs  from  16  to  32
680          bits.   To  support  this change, a range of system calls were added
681          (e.g.,  chown32(2),  getuid32(2),  getgroups32(2),  setresuid32(2)),
682          superseding earlier calls of the same name without the "32" suffix.
683
684       *  Linux  2.4 added support for applications on 32-bit architectures to
685          access large files (i.e., files for which the sizes and file offsets
686          can't  be represented in 32 bits.)  To support this change, replace‐
687          ments were required for system calls that deal with file offsets and
688          sizes.  Thus the following system calls were added: fcntl64(2), get‐
689          dents64(2), stat64(2), statfs64(2), truncate64(2), and their analogs
690          that  work  with  file  descriptors or symbolic links.  These system
691          calls supersede the older system calls which, except in the case  of
692          the "stat" calls, have the same name without the "64" suffix.
693
694          On  newer  platforms  that  only  have 64-bit file access and 32-bit
695          UIDs/GIDs (e.g., alpha, ia64, s390x, x86-64), there is just a single
696          version  of  the UID/GID and file access system calls.  On platforms
697          (typically, 32-bit platforms) where the *64 and *32 calls exist, the
698          other versions are obsolete.
699
700       *  The  rt_sig*  calls were added in kernel 2.2 to support the addition
701          of real-time signals (see signal(7)).  These system calls  supersede
702          the older system calls of the same name without the "rt_" prefix.
703
704       *  The  select(2)  and mmap(2) system calls use five or more arguments,
705          which caused problems in the way argument passing on the  i386  used
706          to be set up.  Thus, while other architectures have sys_select() and
707          sys_mmap() corresponding to __NR_select and __NR_mmap, on  i386  one
708          finds old_select() and old_mmap() (routines that use a pointer to an
709          argument block) instead.  These days passing five arguments is not a
710          problem  any  more,  and there is a __NR__newselect that corresponds
711          directly to sys_select() and similarly  __NR_mmap2.   s390x  is  the
712          only 64-bit architecture that has old_mmap().
713
714   Architecture-specific details: Alpha
715       *  getxgid(2)  returns a pair of GID and effective GID via registers r0
716          and r20; it is provided instead of getgid(2) and getegid(2).
717
718       *  getxpid(2) returns a pair of PID and parent PID via registers r0 and
719          r20; it is provided instead of getpid(2) and getppid(2).
720
721       *  old_adjtimex(2)  is  a  variant  of  adjtimex(2)  that  uses  struct
722          timeval32, for compatibility with OSF/1.
723
724       *  getxuid(2) returns a pair of GID and effective GID via registers  r0
725          and r20; it is provided instead of getuid(2) and geteuid(2).
726
727       *  sethae(2)  is used for configuring the Host Address Extension regis‐
728          ter on low-cost Alphas in order to access address space beyond first
729          27 bits.
730

SEE ALSO

732       intro(2), syscall(2), unimplemented(2), errno(3), libc(7), vdso(7)
733

COLOPHON

735       This  page  is  part of release 5.07 of the Linux man-pages project.  A
736       description of the project, information about reporting bugs,  and  the
737       latest     version     of     this    page,    can    be    found    at
738       https://www.kernel.org/doc/man-pages/.
739
740
741
742Linux                             2020-04-11                       SYSCALLS(2)
Impressum