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 before invoking the system call.

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 truncate64(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 those system calls that are common to most platforms. 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 2.0 or earlier.

  • Where a system call is marked "2.2" this means the system call probably 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 initiated 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 probably 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 initiated 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 probably 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.

  • 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 2.6.22 (or in a few cases only on older kernels) is as follows:

System call Kernel Notes
_llseek(2)    
_newselect(2)    
_sysctl(2)    
accept(2)    
access(2)    
acct(2)    
add_key(2) 2.6.11  
adjtimex(2)    
afs_syscall(2)    
alarm(2)    
alloc_hugepages(2) 2.5.36 Removed in 2.5.44
bdflush(2)    
bind(2)    
break(2)    
brk(2)    
cacheflush(2)   Not on i386
capget(2) 2.2  
capset(2) 2.2  
chdir(2)    
chmod(2)    
chown(2)    
chown32(2) 2.4  
chroot(2)    
clock_getres(2) 2.6  
clock_gettime(2) 2.6  
clock_nanosleep(2) 2.6  
clock_settime(2) 2.6  
clone(2)    
close(2)    
connect(2)    
creat(2)    
create_module(2)    
delete_module(2)    
dup(2)    
dup2(2)    
epoll_create(2) 2.6  
epoll_ctl(2) 2.6  
epoll_pwait(2) 2.6.19  
epoll_wait(2) 2.6  
eventfd(2) 2.6.22  
execve(2)    
exit(2)    
exit_group(2) 2.6; 2.4.20  
faccessat(2) 2.6.16  
fadvise64(2) 2.6  
fadvise64_64(2) 2.6  
fchdir(2)    
fchmod(2)    
fchmodat(2) 2.6.16  
fchown(2)    
fchown32(2) 2.4  
fchownat(2) 2.6.16  
fcntl(2)    
fcntl64(2) 2.4  
fdatasync(2)    
fgetxattr(2) 2.6; 2.4.18  
flistxattr(2) 2.6; 2.4.18  
flock(2)    
fork(2)    
free_hugepages(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)    
fstat64(2) 2.4  
fstatat64(2) 2.6.16  
fstatfs(2)    
fstatfs64(2) 2.6  
fsync(2)    
ftime(2)    
ftruncate(2)    
ftruncate64(2) 2.4  
futex(2) 2.6; 2.4.19  
futimesat(2) 2.6.16  
get_kernel_syms(2)    
get_mempolicy(2) 2.6.6  
get_robust_list(2) 2.6.17  
get_thread_area(2) 2.6; 2.4.20  
getcpu(2) 2.6.19  
getcwd(2) 2.2  
getdents(2)    
getdents64(2) 2.4  
getegid(2)    
getegid32(2) 2.4  
geteuid(2)    
geteuid32(2) 2.4  
getgid(2)    
getgid32(2) 2.4  
getgroups(2)    
getgroups32(2) 2.4  
getitimer(2)    
getpeername(2)    
getpagesize(2)   Not on i386
getpgid(2)    
getpgrp(2)    
getpid(2)    
getpmsg(2) 2.2  
getppid(2)    
getpriority(2)    
getresgid(2) 2.2  
getresgid32(2) 2.4  
getresuid(2) 2.2  
getresuid32(2) 2.4  
getrlimit(2)    
getrusage(2)    
getsid(2)    
getsockname(2)    
getsockopt(2)    
gettid(2) 2.4.11  
gettimeofday(2)    
getuid(2)    
getuid32(2) 2.4  
getxattr(2) 2.6; 2.4.18  
gtty(2)    
idle(2)    
init_module(2)    
inotify_add_watch(2) 2.6.13  
inotify_init(2) 2.6.13  
inotify_rm_watch(2) 2.6.13  
io_cancel(2) 2.6; 2.4.20  
io_destroy(2) 2.6; 2.4.20  
io_getevents(2) 2.6; 2.4.20  
io_setup(2) 2.6; 2.4.20  
io_submit(2) 2.6; 2.4.20  
ioctl(2)    
ioperm(2)    
iopl(2)    
ioprio_get(2) 2.6.13  
ioprio_set(2) 2.6.13  
ipc(2)    
kexec_load(2) 2.6.7  
keyctl(2) 2.6.11  
kill(2)    
lchown(2) 2.2  
lchown32(2) 2.4  
lgetxattr(2) 2.6; 2.4.18  
link(2)    
linkat(2) 2.6.16  
listen(2)    
listxattr(2) 2.6; 2.4.18  
llistxattr(2) 2.6; 2.4.18  
lock(2)    
lookup_dcookie(2) 2.6  
lremovexattr(2) 2.6; 2.4.18  
lseek(2)    
lsetxattr(2) 2.6; 2.4.18  
lstat(2)    
lstat64(2) 2.4  
madvise(2) 2.4  
madvise1(2) 2.4  
mbind(2) 2.6.6  
migrate_pages(2) 2.6.16  
mincore(2) 2.4  
mkdir(2)    
mkdirat(2) 2.6.16  
mknod(2)    
mknodat(2) 2.6.16  
mlock(2)    
mlockall(2)    
mmap(2)    
mmap2(2) 2.4  
modify_ldt(2)    
mount(2)    
move_pages(2) 2.6.18  
mprotect(2)    
mpx(2)    
mq_getsetattr(2) 2.6.6  
mq_notify(2) 2.6.6  
mq_open(2) 2.6.6  
mq_timedreceive(2) 2.6.6  
mq_timedsend(2) 2.6.6  
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) 2.2  
nice(2)    
oldfstat(2)    
oldlstat(2)    
oldolduname(2)    
oldstat(2)    
olduname(2)    
open(2)    
openat(2) 2.6.16  
pause(2)    
pciconfig_iobase(2) 2.2.15; 2.4 Not on i386
pciconfig_read(2) 2.0.26; 2.2 Not on i386
pciconfig_write(2) 2.0.26; 2.2 Not on i386
personality(2)    
phys(2)    
pipe(2)    
pivot_root(2) 2.5  
poll(2) 2.2  
ppoll(2) 2.6.16  
prctl(2) 2.2  
pread64(2)   Added as "pread" in 2.2; renamed "pread64" in 2.6
prof(2)    
profil(2)    
pselect6(2) 2.6.16  
ptrace(2)    
putpmsg(2) 2.2  
pwrite64(2)   Added as "pwrite" in 2.2; renamed "pwrite64" in 2.6
query_module(2) 2.2  
quotactl(2)    
read(2)    
readahead(2) 2.4.13  
readdir(2)    
readlink(2)    
readlinkat(2) 2.6.16  
readv(2)    
reboot(2)    
recv(2)    
recvfrom(2)    
recvmsg(2)    
remap_file_pages(2) 2.6  
removexattr(2) 2.6; 2.4.18  
rename(2)    
renameat(2) 2.6.16  
request_key(2) 2.6.11  
restart_syscall(2) 2.6  
rmdir(2)    
rt_sigaction(2) 2.2  
rt_sigpending(2) 2.2  
rt_sigprocmask(2) 2.2  
rt_sigqueueinfo(2) 2.2  
rt_sigreturn(2) 2.2  
rt_sigsuspend(2) 2.2  
rt_sigtimedwait(2) 2.2  
sched_get_priority_max(2)    
sched_get_priority_min(2)    
sched_getaffinity(2) 2.6; 2.4.19  
sched_getparam(2)    
sched_getscheduler(2)    
sched_rr_get_interval(2)    
sched_setaffinity(2) 2.6; 2.4.19  
sched_setparam(2)    
sched_setscheduler(2)    
sched_yield(2)    
security(2) 2.4.11  
select(2)    
semctl(2)    
semget(2)    
semop(2)    
semtimedop(2) 2.6; 2.4.22  
send(2)    
sendfile(2) 2.2  
sendfile64(2) 2.6; 2.4.19  
sendmsg(2)    
sendto(2)    
set_mempolicy(2) 2.6.6  
set_robust_list(2) 2.6.17  
set_thread_area(2) 2.6; 2.4.20  
set_tid_address(2) 2.6  
set_zone_reclaim(2) 2.6.13 Removed in 2.6.16 (was never available to userspace)
setdomainname(2)    
setfsgid(2)    
setfsgid32(2) 2.4  
setfsuid(2)    
setfsuid32(2) 2.4  
setgid(2)    
setgid32(2) 2.4  
setgroups(2)    
setgroups32(2) 2.4  
sethostname(2)    
setitimer(2)    
setpgid(2)    
setpriority(2)    
setregid(2)    
setregid32(2)