Manual Pages for Linux CentOS command on man syscalls
MyWebUniversity

Manual Pages for Linux CentOS command on man syscalls

SYSCALLS(2) Linux Programmer's Manual SYSCALLS(2)

NAME

syscalls - Linux system calls SYNOPSIS Linux system calls. DESCRIPTION The system call is the fundamental interface between an application and the Linux kernel. System calls and library wrapper functions System calls are generally not invoked directly, but rather via wrapper functions in glibc (or perhaps some other library). For details of direct invocation of a system call, see intro(2). Often, but not always, the name of the wrapper function is the same as the name of the system call that it invokes. For example, glibc contains a function truncate() which invokes the underlying "truncate" system call. Often the glibc wrapper function is quite thin, doing little work other than copying arguments to the right registers before invoking the sys‐ tem call, and then setting errno appropriately after the system call has returned. (These are the same steps that are performed by syscall(2), which can be used to invoke system calls for which no wrap‐ per function is provided.) Note: system calls indicate a failure by returning a negative error number to the caller; when this happens, the wrapper function negates the returned error number (to make it posi‐

tive), copies it to errno, and returns -1 to the caller of the wrapper. Sometimes, however, the wrapper function does some extra work before invoking the system call. For example, nowadays there are (for reasons described below) two related system calls, truncate(2) and trun‐ cate64(2), and the glibc truncate() wrapper function checks which of those system calls are provided by the kernel and determines which should be employed. System call list Below is a list of the Linux system calls. In the list, the Kernel column indicates the kernel version for those system calls that were new in Linux 2.2, or have appeared since that kernel version. Note the following points: * Where no kernel version is indicated, the system call appeared in kernel 1.0 or earlier. * Where a system call is marked "1.2" this means the system call prob‐ ably appeared in a 1.1.x kernel version, and first appeared in a stable kernel with 1.2. (Development of the 1.2 kernel was initi‐ ated from a branch of kernel 1.0.6 via the 1.1.x unstable kernel series.) * Where a system call is marked "2.0" this means the system call prob‐ ably appeared in a 1.3.x kernel version, and first appeared in a stable kernel with 2.0. (Development of the 2.0 kernel was initi‐ ated from a branch of kernel 1.2.x, somewhere around 1.2.10, via the 1.3.x unstable kernel series.) * Where a system call is marked "2.2" this means the system call prob‐ ably appeared in a 2.1.x kernel version, and first appeared in a stable kernel with 2.2.0. (Development of the 2.2 kernel was initi‐ ated from a branch of kernel 2.0.21 via the 2.1.x unstable kernel series.) * Where a system call is marked "2.4" this means the system call prob‐ ably appeared in a 2.3.x kernel version, and first appeared in a stable kernel with 2.4.0. (Development of the 2.4 kernel was initi‐ ated from a branch of kernel 2.2.8 via the 2.3.x unstable kernel series.) * Where a system call is marked "2.6" this means the system call prob‐ ably appeared in a 2.5.x kernel version, and first appeared in a stable kernel with 2.6.0. (Development of kernel 2.6 was initiated from a branch of kernel 2.4.15 via the 2.5.x unstable kernel series.) * Starting with kernel 2.6.0, the development model changed, and new system calls may appear in each 2.6.x release. In this case, the exact version number where the system call appeared is shown. This convention continues with the 3.x kernel series, which followed on from kernel 2.6.39. * In some cases, a system call was added to a stable kernel series after it branched from the previous stable kernel series, and then backported into the earlier stable kernel series. For example some system calls that appeared in 2.6.x were also backported into a 2.4.x release after 2.4.15. When this is so, the version where the system call appeared in both of the major kernel series is listed. The list of system calls that are available as at kernel 3.9 (or in a few cases only on older kernels) is as follows: System call Kernel Notes ───────────────────────────────────────────────────────────────────── llseek(2) 1.2 newselect(2) 2.0 sysctl(2) 2.0 accept(2) 2.0 See notes on socketcall(2) accept4(2) 2.6.28 access(2) 1.0 acct(2) 1.0 addkey(2) 2.6.11 adjtimex(2) 1.0 alarm(2) 1.0 allochugepages(2) 2.5.36 Removed in 2.5.44 bdflush(2) 1.2 Deprecated (does nothing) since 2.6 bind(2) 2.0 See notes on socketcall(2) brk(2) 1.0 cacheflush(2) 1.2 Not on x86 capget(2) 2.2 capset(2) 2.2 chdir(2) 1.0 chmod(2) 1.0 chown(2) 2.2 See chown(2) for version details chown32(2) 2.4 chroot(2) 1.0 clockadjtime(2) 2.6.39 clockgetres(2) 2.6 clockgettime(2) 2.6 clocknanosleep(2) 2.6 clocksettime(2) 2.6 clone(2) 1.0 close(2) 1.0 connect(2) 2.0 See notes on socketcall(2) creat(2) 1.0 createmodule(2) Removed in 2.6 deletemodule(2) 1.0 dup(2) 1.0 dup2(2) 1.0 dup3(2) 2.6.27 epollcreate(2) 2.6 epollcreate1(2) 2.6.27 epollctl(2) 2.6 epollpwait(2) 2.6.19 epollwait(2) 2.6 eventfd(2) 2.6.22 eventfd2(2) 2.6.27 execve(2) 1.0 exit(2) 1.0 exitgroup(2) 2.6 faccessat(2) 2.6.16 fadvise64(2) 2.6 fadvise6464(2) 2.6 fallocate(2) 2.6.23 fanotifyinit(2) 2.6.37 fanotifymark(2) 2.6.37 fchdir(2) 1.0 fchmod(2) 1.0 fchmodat(2) 2.6.16 fchown(2) 1.0 fchown32(2) 2.4 fchownat(2) 2.6.16 fcntl(2) 1.0 fcntl64(2) 2.4 fdatasync(2) 2.0 fgetxattr(2) 2.6; 2.4.18 finitmodule(2) 3.8 flistxattr(2) 2.6; 2.4.18 flock(2) 2.0 fork(2) 1.0 freehugepages(2) 2.5.36 Removed in 2.5.44 fremovexattr(2) 2.6; 2.4.18 fsetxattr(2) 2.6; 2.4.18 fstat(2) 1.0 fstat64(2) 2.4 fstatat64(2) 2.6.16 fstatfs(2) 1.0 fstatfs64(2) 2.6 fsync(2) 1.0 1.0 ftruncate(2) 1.0 ftruncate64(2) 2.4 futex(2) 2.6 futimesat(2) 2.6.16 getkernelsyms(2) Removed in 2.6 getmempolicy(2) 2.6.6 getrobustlist(2) 2.6.17 getthreadarea(2) 2.6 getcpu(2) 2.6.19 getcwd(2) 2.2 getdents(2) 2.0 getdents64(2) 2.4 getegid(2) 1.0 getegid32(2) 2.4 geteuid(2) 1.0 geteuid32(2) 2.4 getgid(2) 1.0 getgid32(2) 2.4 getgroups(2) 1.0 getgroups32(2) 2.4 getitimer(2) 1.0 getpeername(2) 2.0 See notes on socketcall(2) getpagesize(2) 2.0 Not on x86 getpgid(2) 1.0 getpgrp(2) 1.0 getpid(2) 1.0 getppid(2) 1.0 getpriority(2) 1.0 getresgid(2) 2.2 getresgid32(2) 2.4 getresuid(2) 2.2 getresuid32(2) 2.4 getrlimit(2) 1.0 getrusage(2) 1.0 getsid(2) 2.0 getsockname(2) 2.0 See notes on socketcall(2) getsockopt(2) 2.0 See notes on socketcall(2) gettid(2) 2.4.11 gettimeofday(2) 1.0 getuid(2) 1.0 getuid32(2) 2.4 getxattr(2) 2.6; 2.4.18 initmodule(2) 1.0 inotifyaddwatch(2) 2.6.13 inotifyinit(2) 2.6.13 inotifyinit1(2) 2.6.27 inotifyrmwatch(2) 2.6.13 iocancel(2) 2.6 iodestroy(2) 2.6 iogetevents(2) 2.6 iosetup(2) 2.6 iosubmit(2) 2.6 ioctl(2) 1.0 ioperm(2) 1.0 iopl(2) 1.0 ioprioget(2) 2.6.13 ioprioset(2) 2.6.13 ipc(2) 1.0 kcmp(2) 3.5 kernfeatures(2) 3.7 Sparc64 kexecload(2) 2.6.13 keyctl(2) 2.6.11 kill(2) 1.0 lchown(2) 1.0 See chown(2) for version details lchown32(2) 2.4 lgetxattr(2) 2.6; 2.4.18 link(2) 1.0 linkat(2) 2.6.16 listen(2) 2.0 See notes on socketcall(2) listxattr(2) 2.6; 2.4.18 llistxattr(2) 2.6; 2.4.18 lookupdcookie(2) 2.6 lremovexattr(2) 2.6; 2.4.18 lseek(2) 1.0 lsetxattr(2) 2.6; 2.4.18 lstat(2) 1.0 lstat64(2) 2.4 madvise(2) 2.4 madvise1(2) 2.4 mbind(2) 2.6.6 migratepages(2) 2.6.16 mincore(2) 2.4 mkdir(2) 1.0 mkdirat(2) 2.6.16 mknod(2) 1.0 mknodat(2) 2.6.16 mlock(2) 2.0 mlockall(2) 2.0 mmap(2) 1.0 mmap2(2) 2.4 modifyldt(2) 1.0 mount(2) 1.0 movepages(2) 2.6.18 mprotect(2) 1.0 mqgetsetattr(2) 2.6.6 mqnotify(2) 2.6.6 mqopen(2) 2.6.6 mqtimedreceive(2) 2.6.6 mqtimedsend(2) 2.6.6 mqunlink(2) 2.6.6 mremap(2) 2.0 msgctl(2) 2.0 See notes on ipc(2) msgget(2) 2.0 See notes on ipc(2) msgrcv(2) 2.0 See notes on ipc(2) msgsnd(2) 2.0 See notes on ipc(2) msync(2) 2.0 munlock(2) 2.0 munlockall(2) 2.0 munmap(2) 1.0 nametohandleat(2) 2.6.39 nanosleep(2) 2.0 nfsservctl(2) 2.2 Removed in 3.1 nice(2) 1.0 oldfstat(2) 1.0 oldlstat(2) 1.0 oldolduname(2) 1.0 oldstat(2) 1.0 olduname(2) 1.0 open(2) 1.0 openbyhandleat(2) 2.6.39 openat(2) 2.6.16 pause(2) 1.0 pciconfigiobase(2) 2.2.15; 2.4 Not on x86 pciconfigread(2) 2.0.26; 2.2 Not on x86 pciconfigwrite(2) 2.0.26; 2.2 Not on x86 perfeventopen(2) 2.6.31 Was called perfcounteropen() in 2.6.31; renamed in 2.6.32 personality(2) 1.2 perfctr(2) 2.2 Sparc; removed in 2.6.34 perfmonctl(2) 2.4 ia64 pipe(2) 1.0 pipe2(2) 2.6.27 pivotroot(2) 2.4 poll(2) 2.0.36; 2.2 ppcrtas(2) PowerPC only ppoll(2) 2.6.16 prctl(2) 2.2 pread64(2) Added as "pread" in 2.2; renamed "pread64" in 2.6 preadv(2) 2.6.30 prlimit(2) 2.6.36 processvmreadv(2) 3.2 processvmwritev(2) 3.2 pselect6(2) 2.6.16 ptrace(2) 1.0 pwrite64(2) Added as "pwrite" in 2.2; renamed "pwrite64" in 2.6 pwritev(2) 2.6.30 querymodule(2) 2.2 Removed in 2.6 quotactl(2) 1.0 read(2) 1.0 readahead(2) 2.4.13 readdir(2) 1.0 readlink(2) 1.0 readlinkat(2) 2.6.16 readv(2) 2.0 reboot(2) 1.0 recv(2) 2.0 See notes on socketcall(2) recvfrom(2) 2.0 See notes on socketcall(2) recvmsg(2) 2.0 See notes on socketcall(2) recvmmsg(2) 2.6.33 remapfilepages(2) 2.6 removexattr(2) 2.6; 2.4.18 rename(2) 1.0 renameat(2) 2.6.16 requestkey(2) 2.6.11 restartsyscall(2) 2.6 rmdir(2) 1.0 rtsigaction(2) 2.2 rtsigpending(2) 2.2 rtsigprocmask(2) 2.2 rtsigqueueinfo(2) 2.2 rtsigreturn(2) 2.2 rtsigsuspend(2) 2.2 rtsigtimedwait(2) 2.2 rttgsigqueueinfo(2) 2.6.31 s390runtimeinstr(2) 3.7 s390 only schedgetprioritymax(2) 2.0 schedgetprioritymin(2) 2.0 schedgetaffinity(2) 2.6 schedgetparam(2) 2.0 schedgetscheduler(2) 2.0 schedrrgetinterval(2) 2.0 schedsetaffinity(2) 2.6 schedsetparam(2) 2.0 schedsetscheduler(2) 2.0 schedyield(2) 2.0 select(2) 1.0 semctl(2) 2.0 See notes on ipc(2) semget(2) 2.0 See notes on ipc(2) semop(2) 2.0 See notes on ipc(2) semtimedop(2) 2.6; 2.4.22 send(2) 2.0 See notes on socketcall(2) sendfile(2) 2.2 sendfile64(2) 2.6; 2.4.19 sendmmsg(2) 3.0 sendmsg(2) 2.0 See notes on socketcall(2) sendto(2) 2.0 See notes on socketcall(2) setmempolicy(2) 2.6.6 setrobustlist(2) 2.6.17 setthreadarea(2) 2.6 settidaddress(2) 2.6 setdomainname(2) 1.0 setfsgid(2) 1.2 setfsgid32(2) 2.4 setfsuid(2) 1.2 setfsuid32(2) 2.4 setgid(2) 1.0 setgid32(2) 2.4 setgroups(2) 1.0 setgroups32(2) 2.4 sethostname(2) 1.0 setitimer(2) 1.0 setns(2) 3.0 setpgid(2) 1.0 setpriority(2) 1.0 setregid(2) 1.0 setregid32(2) 2.4 setresgid(2) 2.2 setresgid32(2) 2.4 setresuid(2) 2.2 setresuid32(2) 2.4 setreuid(2) 1.0 setreuid32(2) 2.4 setrlimit(2) 1.0 setsid(2) 1.0 setsockopt(2) 2.0 See notes on socketcall(2) settimeofday(2) 1.0 setuid(2) 1.0 setuid32(2) 2.4 setup(2) Removed in 2.2 setxattr(2) 2.6; 2.4.18 sgetmask(2) 1.0 shmat(2) 2.0 See notes on ipc(2) shmctl(2) 2.0 See notes on ipc(2) shmdt(2) 2.0 See notes on ipc(2) shmget(2) 2.0 See notes on ipc(2) shutdown(2) 2.0 See notes on socketcall(2) sigaction(2) 1.0 sigaltstack(2) 2.2 signal(2) 1.0 signalfd(2) 2.6.22 signalfd4(2) 2.6.27 sigpending(2) 1.0 sigprocmask(2) 1.0 sigreturn(2) 1.0 sigsuspend(2) 1.0 socket(2) 2.0 See notes on socketcall(2) socketcall(2) 1.0 socketpair(2) 2.0 See notes on socketcall(2) splice(2) 2.6.17 spucreate(2) 2.6.16 PowerPC only spurun(2) 2.6.16 PowerPC only ssetmask(2) 1.0 stat(2) 1.0 stat64(2) 2.4 statfs(2) 1.0 statfs64(2) 2.6 stime(2) 1.0 subpageprot(2) 2.6.25 PowerPC if CONFIGPPC64KPAGES swapoff(2) 1.0 swapon(2) 1.0 symlink(2) 1.0 symlinkat(2) 2.6.16 sync(2) 1.0 syncfilerange(2) 2.6.17

syncfilerange2(2) 2.6.22 Architecture-specific variant of syncfilerange(2) syncfs(2) 2.6.39 sysfs(2) 1.2 sysinfo(2) 1.0 syslog(2) 1.0 tee(2) 2.6.17 tgkill(2) 2.6 time(2) 1.0 timercreate(2) 2.6 timerdelete(2) 2.6 timergetoverrun(2) 2.6 timergettime(2) 2.6 timersettime(2) 2.6 timerfdcreate(2) 2.6.25 timerfdgettime(2) 2.6.25 timerfdsettime(2) 2.6.25 times(2) 1.0 tkill(2) 2.6; 2.4.22 truncate(2) 1.0 truncate64(2) 2.4 ugetrlimit(2) 2.4 umask(2) 1.0 umount(2) 1.0 umount2(2) 2.2 uname(2) 1.0 unlink(2) 1.0 unlinkat(2) 2.6.16 unshare(2) 2.6.16 uselib(2) 1.0 ustat(2) 1.0 utime(2) 1.0 utimensat(2) 2.6.22 utimes(2) 2.2 utrapinstall(2) 2.2 Sparc vfork(2) 2.2 vhangup(2) 1.0 vm86old(2) 1.0 Was "vm86"; renamed in 2.0.28/2.2 vm86(2) 2.0.28; 2.2 vmsplice(2) 2.6.17 wait4(2) 1.0 waitid(2) 2.6.10 waitpid(2) 1.0 write(2) 1.0 writev(2) 2.0

On many platforms, including x86-32, socket calls are all multiplexed (via glibc wrapper functions) through socketcall(2) and similarly Sys‐ tem V IPC calls are multiplexed through ipc(2). Although slots are reserved for them in the system call table, the fol‐ lowing system calls are not implemented in the standard kernel: afssyscall(2), break(2), ftime(2), getpmsg(2), gtty(2), idle(2), lock(2), madvise1(2), mpx(2), phys(2), prof(2), profil(2), putpmsg(2), security(2), stty(2), tuxcall(2), ulimit(2), and vserver(2) (see also unimplemented(2)). However, ftime(3), profil(3) and ulimit(3) exist as library routines. The slot for phys(2) is in use since kernel 2.1.116 for umount(2); phys(2) will never be implemented. The getpmsg(2) and putpmsg(2) calls are for kernels patched to support STREAMS, and may never be in the standard kernel. There was briefly setzonereclaim(2), added in Linux 2.6.13, and removed in 2.6.16; this system call was never available to user space. NOTES Roughly speaking, the code belonging to the system call with number NRxxx defined in /usr/include/asm/unistd.h can be found in the Linux kernel source in the routine sysxxx(). (The dispatch table for i386 can be found in /usr/src/linux/arch/i386/kernel/entry.S.) There are many exceptions, however, mostly because older system calls were super‐ seded by newer ones, and this has been treated somewhat unsystemati‐

cally. On platforms with proprietary operating-system emulation, such as parisc, sparc, sparc64 and alpha, there are many additional system

calls; mips64 also contains a full set of 32-bit system calls. Over time, changes to the interfaces of some system calls have been necessary. One reason for such changes was the need to increase the size of structures or scalar values passed to the system call. Because of these changes, there are now various groups of related system calls (e.g., truncate(2) and truncate64(2)) which perform similar tasks, but which vary in details such as the size of their arguments. (As noted earlier, applications are generally unaware of this: the glibc wrapper functions do some work to ensure that the right system call is invoked, and that ABI compatibility is preserved for old binaries.) Examples of systems calls that exist in multiple versions are the following: * By now there are three different versions of stat(2): sysstat() (slot NRoldstat), sysnewstat() (slot NRstat), and sysstat64() (slot NRstat64), with the last being the most cur‐ rent. A similar story applies for lstat(2) and fstat(2). * Similarly, the defines NRoldolduname, NRolduname, and NRuname refer to the routines sysolduname(), sysuname() and sysnewuname(). * In Linux 2.0, a new version of vm86(2) appeared, with the old and the new kernel routines being named sysvm86old() and sysvm86(). * In Linux 2.4, a new version of getrlimit(2) appeared, with the old and the new kernel routines being named sysoldgetrlimit() (slot NRgetrlimit) and sysgetrlimit() (slot NRugetrlimit). * Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. To support this change, a range of system calls were added (e.g., chown32(2), getuid32(2), getgroups32(2), setresuid32(2)), superseding earlier calls of the same name without the "32" suffix.

* Linux 2.4 added support for applications on 32-bit architectures to access large files (i.e., files for which the sizes and file offsets can't be represented in 32 bits.) To support this change, replace‐ ments were required for system calls that deal with file offsets and sizes. Thus the following system calls were added: fcntl64(2), ftruncate64(2), getdents64(2), stat64(2), statfs64(2), and their analogs that work with file descriptors or symbolic links. These system calls supersede the older system calls which, except in the case of the "stat" calls, have the same name without the "64" suf‐ fix.

On newer platforms that only have 64-bit file access and 32-bit uids (e.g., alpha, ia64, s390x) there are no *64 or *32 calls. Where the *64 and *32 calls exist, the other versions are obsolete. * The rtsig* calls were added in kernel 2.2 to support the addition

of real-time signals (see signal(7)). These system calls supersede the older system calls of the same name without the "rt" prefix. * The select(2) and mmap(2) system calls use five or more arguments, which caused problems in the way argument passing on the i386 used to be set up. Thus, while other architectures have sysselect() and sysmmap() corresponding to NRselect and NRmmap, on i386 one finds oldselect() and oldmmap() (routines that use a pointer to a argument block) instead. These days passing five arguments is not a problem any more, and there is a NRnewselect that corresponds directly to sysselect() and similarly NRmmap2. SEE ALSO syscall(2), unimplemented(2), libc(7) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2013-04-17 SYSCALLS(2)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™