syscalls
SYSCALLS(2) Linux Programmer’s Manual SYSCALLS(2)
NAME
none - list of all system calls
SYNOPSIS
Linux 2.6 system calls.
DESCRIPTION
The system call is the fundamental interface between an application
and the Linux kernel. As of Linux 2.6.9, there are 945 system calls;
this man page lists those that are common to most platforms.
_llseek(2), _newselect(2), _sysctl(2), accept(2), access(2), acct(2),
adjtimex(2), afs_syscall(2), alarm(2), bdflush(2), bind(2), break(2),
brk(2), capget(2), capset(2), chdir(2), chmod(2), chown(2),
chown32(2), chroot(2), clock_getres(2), clock_gettime(2), clock-
_nanosleep(2), clock_settime(2), clone(2), close(2), connect(2),
creat(2), create_module(2), delete_module(2), dup(2), dup2(2), epoll-
_create(2), epoll_ctl(2), epoll_wait(2), execve(2), exit(2), exit-
_group(2), fadvise64(2), fadvise64_64(2), fchdir(2), fchmod(2),
fchown(2), fchown32(2), fcntl(2), fcntl64(2), fdatasync(2), fget-
xattr(2), flistxattr(2), flock(2), fork(2), fremovexattr(2), fset-
xattr(2), fstat(2), fstat64(2), fstatfs(2), fstatfs64(2), fsync(2),
ftime(2), ftruncate(2), ftruncate64(2), futex(2), get_kernel_syms(2),
getcwd(2), getdents(2), getdents64(2), getegid(2), getegid32(2), get-
euid(2), geteuid32(2), getgid(2), getgid32(2), getgroups(2), get-
groups32(2), getitimer(2), getpeername(2), getpgid(2), getpgrp(2),
getpid(2), getpmsg(2), getppid(2), getpriority(2), getresgid(2), get-
resgid32(2), getresuid(2), getresuid32(2), getrlimit(2), getrusage(2),
getsid(2), getsockname(2), getsockopt(2), gettid(2), gettimeofday(2),
getuid(2), getuid32(2), getxattr(2), gtty(2), idle(2), init_module(2),
io_cancel(2), io_destroy(2), io_getevents(2), io_setup(2), io-
_submit(2), ioctl(2), ioperm(2), ipc(2), kill(2), lchown(2),
lchown32(2), lgetxattr(2), link(2), listen(2), listxattr(2), llistx-
attr(2), lock(2), lookup_dcookie(2), lremovexattr(2), lseek(2), lset-
xattr(2), lstat(2), lstat64(2), madvise(2), mincore(2), mkdir(2),
mknod(2), mlock(2), mlockall(2), mmap(2), mmap2(2), mount(2), mpro-
tect(2), mpx(2), mq_getsetattr(2), mq_notify(2), mq_open(2), mq-
_timedreceive(2), mq_timedsend(2), mq_unlink(2), mremap(2), msgctl(2),
msgget(2), msgrcv(2), msgsnd(2), msync(2), munlock(2), munlockall(2),
munmap(2), nanosleep(2), nfsservctl(2), nice(2), oldlstat(2), open(2),
pause(2), personality(2), pipe(2), pivot_root(2), poll(2), prctl(2),
pread64(2), prof(2), profil(2), ptrace(2), putpmsg(2), pwrite64(2),
query_module(2), quotactl(2), read(2), readahead(2), readdir(2), read-
link(2), readv(2), reboot(2), recv(2), recvfrom(2), recvmsg(2), remap-
_file_pages(2), removexattr(2), rename(2), restart_syscall(2),
rmdir(2), rt_sigaction(2), rt_sigpending(2), rt_sigprocmask(2),
rt_sigqueueinfo(2), rt_sigreturn(2), rt_sigsuspend(2), rt_sig-
timedwait(2), sched_get_priority_max(2), sched_get_priority_min(2),
sched_getaffinity(2), sched_getparam(2), sched_getscheduler(2), sched-
_rr_get_interval(2), sched_setaffinity(2), sched_setparam(2), sched-
_setscheduler(2), sched_yield(2), select(2), semctl(2), semget(2),
semop(2), semtimedop(2), send(2), sendfile(2), sendfile64(2),
sendmsg(2), sendto(2), set_tid_address(2), setdomainname(2), set-
fsgid(2), setfsgid32(2), setfsuid(2), setfsuid32(2), setgid(2), set-
gid32(2), setgroups(2), setgroups32(2), sethostname(2), setitimer(2),
setpgid(2), setpriority(2), setregid(2), setregid32(2), setresgid(2),
setresgid32(2), setresuid(2), setresuid32(2), setreuid(2), set-
reuid32(2), setrlimit(2), setsid(2), setsockopt(2), settimeofday(2),
setuid(2), setuid32(2), setxattr(2), sgetmask(2), shmat(2), shmctl(2),
shmdt(2), shmget(2), shutdown(2), sigaction(2), sigaltstack(2), sig-
nal(2), sigpending(2), sigprocmask(2), sigreturn(2), sigsuspend(2),
socket(2), socketcall(2), socketpair(2), ssetmask(2), stat(2),
stat64(2), statfs(2), statfs64(2), stime(2), stty(2), swapoff(2),
swapon(2), symlink(2), sync(2), sysfs(2), sysinfo(2), syslog(2),
tgkill(2), time(2), timer_create(2), timer_delete(2), timer_get-
overrun(2), timer_gettime(2), timer_settime(2), times(2), tkill(2),
truncate(2), truncate64(2), ugetrlimit(2), ulimit(2), umask(2),
umount(2), umount2(2), uname(2), unlink(2), uselib(2), ustat(2),
utime(2), utimes(2), vfork(2), vhangup(2), wait4(2), waitpid(2),
write(2), writev(2).
Of the above, 5 are not implemented in standard kernel, reserved for
future or special use, namely afs_syscall, getpmsg, putpmsg,
kexec_load, vserver. For example, the getpmsg and putpmsg calls are
for kernels patched to support streams, and may never be in the stan-
dard kernel. Another 12 system calls are unimplemented obsolete
calls, namely break, create_module, ftime, get_kernel_syms, gtty,
lock, mpx, prof, profil, stty, sys_query_module, ulimit. However,
ftime(3), profil(3), and ulimit(3) exist as library routines. Another
unimplemented obsolete system call was phys; but its slot is in use
since 2.1.116 for umount, so phys will never be implemented. (See
also obsolete(2) and unimplemented(2).)
Roughly speaking, the code belonging to the system call with number
__NR_xxx defined in /usr/include/asm-*/unistd.h can be found in the
kernel source in the routine sys_xxx(). (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
superseded by newer ones, and this has been treated somewhat unsystem-
atically. On platforms with proprietary OS 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.
The defines __NR_oldstat and __NR_stat refer to the routines
sys_stat() and sys_newstat(), and likewise for fstat and lstat. Simi-
larly, the defines __NR_oldolduname, __NR_olduname and __NR_uname
refer to the routines sys_olduname(), sys_uname(), and sys_newuname().
Thus, __NR_stat and __NR_uname have always referred to the latest ver-
sion of the system call, and the older ones are for backward compati-
bility.
It is different with select and mmap. These use five or more parame-
ters, and caused problems the way parameter passing on the i386 used
to be set up. Thus, while other architectures have sys_select() and
sys_mmap() corresponding to __NR_select and __NR_mmap, on i386 one
finds old_select() and old_mmap() (routines that use a pointer to a
parameter block) instead. These days passing five parameters is not a
problem any more, and there is a __NR__newselect (used by libc 6) that
corresponds directly to sys_select() and similarly __NR_mmap2.
Two other system call numbers, __NR__llseek and __NR__sysctl have an
additional underscore absent in sys_llseek() and sys_sysctl().
Then there is __NR_readdir corresponding to old_readdir(), which will
read at most one directory entry at a time, and is superseded by
sys_getdents().
On many platforms, including i386, socket calls are all multiplexed
through socketcall(2) and System V IPC calls through ipc(2).
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 chown and lchown system calls were swapped in 2.1.81. The *64 and
*32 calls were added for kernel 2.4, as were the new versions of getr-
limit and mmap, and the new calls pivot_root, mincore, madvise,
security, gettid and readahead. The security call is no longer
present in 2.6 kernels.
Linux 2.6 2007-06-14 SYSCALLS(2)