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.
87
88       *  In  some  cases,  a  system call was added to a stable kernel series
89          after it branched from the previous stable kernel series,  and  then
90          backported  into the earlier stable kernel series.  For example some
91          system calls that appeared in 2.6.x  were  also  backported  into  a
92          2.4.x  release after 2.4.15.  When this is so, the version where the
93          system call appeared in both of the major kernel series is listed.
94
95       The list of system calls that are available as at kernel 4.19 (or in  a
96       few cases only on older kernels) is as follows:
97
98       System call                Kernel        Notes
99       ───────────────────────────────────────────────────────────────────────
100
101       _llseek(2)                 1.2
102       _newselect(2)              2.0
103       _sysctl(2)                 2.0
104       accept(2)                  2.0           See notes on socketcall(2)
105       accept4(2)                 2.6.28
106       access(2)                  1.0
107       acct(2)                    1.0
108       add_key(2)                 2.6.10
109       adjtimex(2)                1.0
110       alarm(2)                   1.0
111       alloc_hugepages(2)         2.5.36        Removed in 2.5.44
112       arc_gettls(2)              3.9           ARC only
113       arc_settls(2)              3.9           ARC only
114       arc_usr_cmpxchg(2)         4.9           ARC only
115       arch_prctl(2)              2.6           x86_64, x86 since 4.12
116       atomic_barrier(2)          2.6.34        m68k only
117       atomic_cmpxchg_32(2)       2.6.34        m68k only
118       bdflush(2)                 1.2           Deprecated (does nothing)
119                                                since 2.6
120       bfin_spinlock(2)           2.6.22        Blackfin only (port removed
121                                                in Linux 4.17)
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
134                                                version 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       close(2)                   1.0
145       cmpxchg_badaddr(2)         2.6.36        Tile only (port removed
146                                                in Linux 4.17)
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       dma_memcpy(2)              2.6.22        Blackfin only (port removed
153                                                in Linux 4.17)
154       dup(2)                     1.0
155       dup2(2)                    1.0
156       dup3(2)                    2.6.27
157       epoll_create(2)            2.6
158       epoll_create1(2)           2.6.27
159       epoll_ctl(2)               2.6
160       epoll_pwait(2)             2.6.19
161       epoll_wait(2)              2.6
162       eventfd(2)                 2.6.22
163       eventfd2(2)                2.6.27
164       execv(2)                   2.0           SPARC/SPARC64 only, for
165                                                compatibility with SunOS
166       execve(2)                  1.0
167       execveat(2)                3.19
168       exit(2)                    1.0
169       exit_group(2)              2.6
170       faccessat(2)               2.6.16
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       fsetxattr(2)               2.6; 2.4.18
193       fstat(2)                   1.0
194       fstat64(2)                 2.4
195       fstatat64(2)               2.6.16
196       fstatfs(2)                 1.0
197       fstatfs64(2)               2.6
198
199       fsync(2)                   1.0
200       ftruncate(2)               1.0
201       ftruncate64(2)             2.4
202       futex(2)                   2.6
203       futimesat(2)               2.6.16
204       get_kernel_syms(2)         1.0           Removed in 2.6
205       get_mempolicy(2)           2.6.6
206       get_robust_list(2)         2.6.17
207       get_thread_area(2)         2.6
208       get_tls(2)                 4.15          ARM OABI only, has
209                                                __ARM_NR prefix
210       getcpu(2)                  2.6.19
211       getcwd(2)                  2.2
212       getdents(2)                2.0
213       getdents64(2)              2.4
214       getdomainname(2)           2.2           SPARC, SPARC64; available
215                                                as osf_getdomainname(2)
216                                                on Alpha since Linux 2.0
217       getdtablesize(2)           2.0           SPARC (removed in 2.6.26),
218                                                available since Linux 2.0 on
219                                                Alpha as osf_getdtablesize(2)
220       getegid(2)                 1.0
221       getegid32(2)               2.4
222       geteuid(2)                 1.0
223       geteuid32(2)               2.4
224       getgid(2)                  1.0
225       getgid32(2)                2.4
226       getgroups(2)               1.0
227       getgroups32(2)             2.4
228       gethostname(2)             2.0           Alpha, was available on
229                                                SPARC up to Linux 2.6.26
230       getitimer(2)               1.0
231       getpeername(2)             2.0           See notes on socketcall(2)
232       getpagesize(2)             2.0           Not on x86
233       getpgid(2)                 1.0
234       getpgrp(2)                 1.0
235       getpid(2)                  1.0
236       getppid(2)                 1.0
237       getpriority(2)             1.0
238       getrandom(2)               3.17
239       getresgid(2)               2.2
240       getresgid32(2)             2.4
241       getresuid(2)               2.2
242       getresuid32(2)             2.4
243       getrlimit(2)               1.0
244       getrusage(2)               1.0
245       getsid(2)                  2.0
246       getsockname(2)             2.0           See notes on socketcall(2)
247       getsockopt(2)              2.0           See notes on socketcall(2)
248       gettid(2)                  2.4.11
249       gettimeofday(2)            1.0
250       getuid(2)                  1.0
251       getuid32(2)                2.4
252       getunwind(2)               2.4.8         IA-64 only; deprecated
253       getxattr(2)                2.6; 2.4.18
254       getxgid(2)                 2.0           Alpha only; see NOTES
255       getxpid(2)                 2.0           Alpha only; see NOTES
256       getxuid(2)                 2.0           Alpha only; see NOTES
257       init_module(2)             1.0
258       inotify_add_watch(2)       2.6.13
259       inotify_init(2)            2.6.13
260       inotify_init1(2)           2.6.27
261       inotify_rm_watch(2)        2.6.13
262       io_cancel(2)               2.6
263       io_destroy(2)              2.6
264
265       io_getevents(2)            2.6
266       io_pgetevents(2)           4.18
267       io_setup(2)                2.6
268       io_submit(2)               2.6
269       ioctl(2)                   1.0
270       ioperm(2)                  1.0
271       iopl(2)                    1.0
272       ioprio_get(2)              2.6.13
273       ioprio_set(2)              2.6.13
274       ipc(2)                     1.0
275       kcmp(2)                    3.5
276       kern_features(2)           3.7           SPARC64 only
277       kexec_file_load(2)         3.17
278       kexec_load(2)              2.6.13
279       keyctl(2)                  2.6.10
280       kill(2)                    1.0
281       lchown(2)                  1.0           See chown(2) for
282                                                version details
283       lchown32(2)                2.4
284       lgetxattr(2)               2.6; 2.4.18
285       link(2)                    1.0
286       linkat(2)                  2.6.16
287       listen(2)                  2.0           See notes on socketcall(2)
288       listxattr(2)               2.6; 2.4.18
289       llistxattr(2)              2.6; 2.4.18
290       lookup_dcookie(2)          2.6
291       lremovexattr(2)            2.6; 2.4.18
292       lseek(2)                   1.0
293       lsetxattr(2)               2.6; 2.4.18
294       lstat(2)                   1.0
295       lstat64(2)                 2.4
296       madvise(2)                 2.4
297       mbind(2)                   2.6.6
298       memory_ordering(2)         2.2           SPARC64 only
299       metag_get_tls(2)           3.9           Metag only (port removed
300                                                in Linux 4.17)
301       metag_set_fpu_flags(2)     3.9           Metag only (port removed
302                                                in Linux 4.17)
303       metag_set_tls(2)           3.9           Metag only (port removed
304                                                in Linux 4.17)
305       metag_setglobalbit(2)      3.9           Metag only (port removed
306                                                in Linux 4.17)
307       membarrier(2)              3.17
308       memfd_create(2)            3.17
309       migrate_pages(2)           2.6.16
310       mincore(2)                 2.4
311       mkdir(2)                   1.0
312       mkdirat(2)                 2.6.16
313       mknod(2)                   1.0
314       mknodat(2)                 2.6.16
315       mlock(2)                   2.0
316       mlock2(2)                  4.4
317       mlockall(2)                2.0
318       mmap(2)                    1.0
319       mmap2(2)                   2.4
320       modify_ldt(2)              1.0
321       mount(2)                   1.0
322       move_pages(2)              2.6.18
323       mprotect(2)                1.0
324       mq_getsetattr(2)           2.6.6
325       mq_notify(2)               2.6.6
326       mq_open(2)                 2.6.6
327       mq_timedreceive(2)         2.6.6
328       mq_timedsend(2)            2.6.6
329       mq_unlink(2)               2.6.6
330
331       mremap(2)                  2.0
332       msgctl(2)                  2.0           See notes on ipc(2)
333       msgget(2)                  2.0           See notes on ipc(2)
334       msgrcv(2)                  2.0           See notes on ipc(2)
335       msgsnd(2)                  2.0           See notes on ipc(2)
336       msync(2)                   2.0
337       munlock(2)                 2.0
338       munlockall(2)              2.0
339       munmap(2)                  1.0
340       name_to_handle_at(2)       2.6.39
341       nanosleep(2)               2.0
342       newfstatat(2)              2.6.16        See stat(2)
343       nfsservctl(2)              2.2           Removed in 3.1
344       nice(2)                    1.0
345       old_adjtimex(2)            2.0           Alpha only; see NOTES
346       old_getrlimit(2)           2.4           Old variant of getrlimit(2)
347                                                that used a different value
348                                                for RLIM_INFINITY
349       oldfstat(2)                1.0
350       oldlstat(2)                1.0
351       oldolduname(2)             1.0
352       oldstat(2)                 1.0
353       oldumount(2)               2.4.116       Name of the old umount(2)
354                                                syscall on Alpha
355       olduname(2)                1.0
356       open(2)                    1.0
357       open_by_handle_at(2)       2.6.39
358       openat(2)                  2.6.16
359       or1k_atomic(2)             3.1           OpenRISC 1000 only
360       pause(2)                   1.0
361       pciconfig_iobase(2)        2.2.15; 2.4   Not on x86
362       pciconfig_read(2)          2.0.26; 2.2   Not on x86
363       pciconfig_write(2)         2.0.26; 2.2   Not on x86
364       perf_event_open(2)         2.6.31        Was perf_counter_open() in
365                                                2.6.31; renamed in 2.6.32
366       personality(2)             1.2
367       perfctr(2)                 2.2           SPARC only; removed in 2.6.34
368       perfmonctl(2)              2.4           IA-64 only
369       pipe(2)                    1.0
370       pipe2(2)                   2.6.27
371       pivot_root(2)              2.4
372       pkey_alloc(2)              4.8
373       pkey_free(2)               4.8
374       pkey_mprotect(2)           4.8
375       poll(2)                    2.0.36; 2.2
376       ppoll(2)                   2.6.16
377       prctl(2)                   2.2
378       pread(2)                                 Used for pread64(2) on AVR32
379                                                (port removed in Linux 4.12)
380                                                and Blackfin (port removed
381                                                in Linux 4.17)
382       pread64(2)                               Added as "pread" in 2.2;
383                                                renamed "pread64" in 2.6
384       preadv(2)                  2.6.30
385       preadv2(2)                 4.6
386       prlimit64(2)               2.6.36
387       process_vm_readv(2)        3.2
388       process_vm_writev(2)       3.2
389       pselect6(2)                2.6.16
390       ptrace(2)                  1.0
391       pwrite(2)                                Used for pwrite64(2) on AVR32
392                                                (port removed in Linux 4.12)
393                                                and Blackfin (port removed in
394                                                Linux 4.17)
395
396
397       pwrite64(2)                              Added as "pwrite" in 2.2;
398                                                renamed "pwrite64" in 2.6
399       pwritev(2)                 2.6.30
400       pwritev2(2)                4.6
401       query_module(2)            2.2           Removed in 2.6
402       quotactl(2)                1.0
403       read(2)                    1.0
404       readahead(2)               2.4.13
405       readdir(2)                 1.0
406       readlink(2)                1.0
407       readlinkat(2)              2.6.16
408       readv(2)                   2.0
409       reboot(2)                  1.0
410       recv(2)                    2.0           See notes on socketcall(2)
411       recvfrom(2)                2.0           See notes on socketcall(2)
412       recvmsg(2)                 2.0           See notes on socketcall(2)
413       recvmmsg(2)                2.6.33
414       remap_file_pages(2)        2.6           Deprecated since 3.16
415       removexattr(2)             2.6; 2.4.18
416       rename(2)                  1.0
417       renameat(2)                2.6.16
418       renameat2(2)               3.15
419       request_key(2)             2.6.10
420       restart_syscall(2)         2.6
421       riscv_flush_icache(2)      4.15          RISC-V only
422       rmdir(2)                   1.0
423       rseq(2)                    4.18
424       rt_sigaction(2)            2.2
425       rt_sigpending(2)           2.2
426       rt_sigprocmask(2)          2.2
427       rt_sigqueueinfo(2)         2.2
428       rt_sigreturn(2)            2.2
429       rt_sigsuspend(2)           2.2
430       rt_sigtimedwait(2)         2.2
431       rt_tgsigqueueinfo(2)       2.6.31
432       rtas(2)                    2.6.2         PowerPC/PowerPC64 only
433       s390_runtime_instr(2)      3.7           s390 only
434       s390_pci_mmio_read(2)      3.19          s390 only
435       s390_pci_mmio_write(2)     3.19          s390 only
436       s390_sthyi(2)              4.15          s390 only
437       s390_guarded_storage(2)    4.12          s390 only
438       sched_get_affinity(2)      2.6           Name of sched_getaffinity(2)
439                                                on SPARC and SPARC64
440       sched_get_priority_max(2)  2.0
441       sched_get_priority_min(2)  2.0
442       sched_getaffinity(2)       2.6
443       sched_getattr(2)           3.14
444       sched_getparam(2)          2.0
445       sched_getscheduler(2)      2.0
446       sched_rr_get_interval(2)   2.0
447       sched_set_affinity(2)      2.6           Name of sched_setaffinity(2)
448                                                on SPARC and SPARC64
449       sched_setaffinity(2)       2.6
450       sched_setattr(2)           3.14
451       sched_setparam(2)          2.0
452       sched_setscheduler(2)      2.0
453       sched_yield(2)             2.0
454       seccomp(2)                 3.17
455       select(2)                  1.0
456       semctl(2)                  2.0           See notes on ipc(2)
457       semget(2)                  2.0           See notes on ipc(2)
458       semop(2)                   2.0           See notes on ipc(2)
459       semtimedop(2)              2.6; 2.4.22
460       send(2)                    2.0           See notes on socketcall(2)
461       sendfile(2)                2.2
462
463       sendfile64(2)              2.6; 2.4.19
464       sendmmsg(2)                3.0
465       sendmsg(2)                 2.0           See notes on socketcall(2)
466       sendto(2)                  2.0           See notes on socketcall(2)
467       set_mempolicy(2)           2.6.6
468       set_robust_list(2)         2.6.17
469       set_thread_area(2)         2.6
470       set_tid_address(2)         2.6
471       set_tls(2)                 2.6.11        ARM OABI/EABI only (constant
472                                                has __ARM_NR prefix)
473       setdomainname(2)           1.0
474       setfsgid(2)                1.2
475       setfsgid32(2)              2.4
476       setfsuid(2)                1.2
477       setfsuid32(2)              2.4
478       setgid(2)                  1.0
479       setgid32(2)                2.4
480       setgroups(2)               1.0
481       setgroups32(2)             2.4
482       sethae(2)                  2.0           Alpha only; see NOTES
483       sethostname(2)             1.0
484       setitimer(2)               1.0
485       setns(2)                   3.0
486       setpgid(2)                 1.0
487       setpgrp(2)                 2.0           Alternative name for
488                                                setpgid(2) on Alpha
489       setpriority(2)             1.0
490       setregid(2)                1.0
491       setregid32(2)              2.4
492       setresgid(2)               2.2
493       setresgid32(2)             2.4
494       setresuid(2)               2.2
495       setresuid32(2)             2.4
496       setreuid(2)                1.0
497       setreuid32(2)              2.4
498       setrlimit(2)               1.0
499       setsid(2)                  1.0
500       setsockopt(2)              2.0           See notes on socketcall(2)
501       settimeofday(2)            1.0
502       setuid(2)                  1.0
503       setuid32(2)                2.4
504       setup(2)                   1.0           Removed in 2.2
505       setxattr(2)                2.6; 2.4.18
506       sgetmask(2)                1.0
507       shmat(2)                   2.0           See notes on ipc(2)
508       shmctl(2)                  2.0           See notes on ipc(2)
509       shmdt(2)                   2.0           See notes on ipc(2)
510       shmget(2)                  2.0           See notes on ipc(2)
511       shutdown(2)                2.0           See notes on socketcall(2)
512       sigaction(2)               1.0
513       sigaltstack(2)             2.2
514       signal(2)                  1.0
515       signalfd(2)                2.6.22
516       signalfd4(2)               2.6.27
517       sigpending(2)              1.0
518       sigprocmask(2)             1.0
519       sigreturn(2)               1.0
520       sigsuspend(2)              1.0
521       socket(2)                  2.0           See notes on socketcall(2)
522       socketcall(2)              1.0
523       socketpair(2)              2.0           See notes on socketcall(2)
524       spill(2)                   2.6.13        Xtensa only
525       splice(2)                  2.6.17
526       spu_create(2)              2.6.16        PowerPC/PowerPC64 only
527       spu_run(2)                 2.6.16        PowerPC/PowerPC64 only
528
529       sram_alloc(2)              2.6.22        Blackfin (port removed
530                                                in Linux 4.17)
531       sram_free(2)               2.6.22        Blackfin (port removed
532                                                in Linux 4.17)
533       ssetmask(2)                1.0
534       stat(2)                    1.0
535       stat64(2)                  2.4
536       statfs(2)                  1.0
537       statfs64(2)                2.6
538       statx(2)                   4.11
539       stime(2)                   1.0
540       subpage_prot(2)            2.6.25        PowerPC/PowerPC64 only
541       swapcontext(2)             2.6.3         PowerPC/PowerPC64 only
542       switch_endian(2)           4.1           PowerPC64 only
543       swapcontext(2)             2.6.3         PowerPC only
544       swapoff(2)                 1.0
545       swapon(2)                  1.0
546       symlink(2)                 1.0
547       symlinkat(2)               2.6.16
548       sync(2)                    1.0
549       sync_file_range(2)         2.6.17
550       sync_file_range2(2)        2.6.22
551       syncfs(2)                  2.6.39
552       sys_debug_setcontext(2)    2.6.11        PowerPC only
553       syscall(2)                 1.0           Still available on ARM OABI
554                                                and MIPS O32 ABI
555       sysfs(2)                   1.2
556       sysinfo(2)                 1.0
557       syslog(2)                  1.0
558       sysmips(2)                 2.6.0         MIPS only
559       tee(2)                     2.6.17
560       tgkill(2)                  2.6
561       time(2)                    1.0
562       timer_create(2)            2.6
563       timer_delete(2)            2.6
564       timer_getoverrun(2)        2.6
565       timer_gettime(2)           2.6
566       timer_settime(2)           2.6
567       timerfd_create(2)          2.6.25
568       timerfd_gettime(2)         2.6.25
569       timerfd_settime(2)         2.6.25
570       times(2)                   1.0
571       tkill(2)                   2.6; 2.4.22
572       truncate(2)                1.0
573       truncate64(2)              2.4
574       ugetrlimit(2)              2.4
575       umask(2)                   1.0
576       umount(2)                  1.0
577       umount2(2)                 2.2
578       uname(2)                   1.0
579       unlink(2)                  1.0
580       unlinkat(2)                2.6.16
581       unshare(2)                 2.6.16
582       uselib(2)                  1.0
583       ustat(2)                   1.0
584       userfaultfd(2)             4.3
585       usr26(2)                   2.4.8.1       ARM OABI only
586       usr32(2)                   2.4.8.1       ARM OABI only
587       utime(2)                   1.0
588       utimensat(2)               2.6.22
589       utimes(2)                  2.2
590       utrap_install(2)           2.2           SPARC64 only
591       vfork(2)                   2.2
592       vhangup(2)                 1.0
593
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  kernel
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
622       removed in 2.6.16; this system call was never available to user space.
623

NOTES

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

SEE ALSO

716       intro(2), syscall(2), unimplemented(2), errno(3), libc(7), vdso(7)
717

COLOPHON

719       This  page  is  part of release 5.02 of the Linux man-pages project.  A
720       description of the project, information about reporting bugs,  and  the
721       latest     version     of     this    page,    can    be    found    at
722       https://www.kernel.org/doc/man-pages/.
723
724
725
726Linux                             2019-03-06                       SYSCALLS(2)
Impressum