diff --git a/man2/syscalls.2 b/man2/syscalls.2 index 025aefef7..9917bef0e 100644 --- a/man2/syscalls.2 +++ b/man2/syscalls.2 @@ -1,3 +1,7 @@ +.\" Copyright (C) 2007 Michael Kerrisk +.\" with some input from Stepan Kasal +.\" +.\" Some content retained from an earlier version of this page: .\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) .\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern .\" @@ -22,235 +26,488 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH SYSCALLS 2 2002-01-07 "Linux" "Linux Programmer's Manual" +.TH SYSCALLS 2 2007-07-07 "Linux" "Linux Programmer's Manual" .SH NAME -none \- list of all system calls +syscalls \- Linux system calls .SH SYNOPSIS -Linux 2.4 system calls. +Linux system calls. .SH DESCRIPTION The system call is the fundamental interface between an application and the Linux kernel. -As of Linux 2.4.17, there are 1100 system calls -listed in -.IR /usr/src/linux/include/asm-*/unistd.h . -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, -alarm(2), -bdflush(2), -bind(2), -break, -brk(2), -cacheflush(2), -capget(2), -capset(2), -chdir(2), -chmod(2), -chown(2), chown32, -chroot(2), -clone(2), -close(2), -connect(2), -creat(2), -create_module(2), -delete_module(2), -dup(2), -dup2(2), -execve(2), -exit(2), -fchdir(2), -fchmod(2), -fchown(2), fchown32, -fcntl(2), fcntl64, -fdatasync(2), -flock(2), -fork(2), -fstat(2), fstat64, -fstatfs(2), -fsync(2), -ftime, -ftruncate(2), ftruncate64, -get\%_kernel\%_syms(2), -get\%cwd(2), -get\%dents(2), get\%dents64, -get\%egid(2), get\%egid32, -get\%euid(2), get\%euid32, -get\%gid(2), get\%gid32, -get\%groups(2), get\%groups32, -get\%itimer(2), -get\%pagesize(2), -get\%peername(2), -get\%pmsg, -get\%pgid(2), -get\%pgrp(2), -get\%pid(2), -get\%ppid(2), -get\%priority(2), -get\%resgid(2), get\%resgid32, -get\%resuid(2), get\%resuid32, -get\%rlimit(2), -get\%rusage(2), -get\%sid(2), -get\%sockname(2), -get\%sockopt(2), -get\%tid, -get\%timeofday(2), -get\%uid(2), get\%uid32, -gtty, -idle, -init_module(2), -ioctl(2), -io\%perm(2), -iopl(2), -ipc(2), -kill(2), -lchown(2), lchown32, -link(2), -listen(2), -lock, -lseek(2), -lstat(2), lstat64, -madvise(2), -mincore(2), -mkdir(2), -mknod(2), -mlock(2), -mlockall(2), -mmap(2), -modify_ldt(2), -mount(2), -mprotect(2), -mpx, -mremap(2), -msync(2), -munlock(2), -munlockall(2), -munmap(2), -nanosleep(2), -nfsservctl(2), -nice(2), -oldfstat, oldlstat, oldolduname, oldstat, oldumount, olduname, -open(2), -pause(2), -personality(2), -phys, -pipe(2), -pivot_root(2), -poll(2), -prctl(2), -pread(2), -prof, profil, -ptrace(2), -putpmsg, -pwrite(2), -query_module(2), -quotactl(2), -read(2), -readahead, -readdir(2), -readlink(2), -readv(2), -reboot(2), -recv(2), recvfrom(2), recvmsg(2), -rename(2), -rmdir(2), -rt_sigaction, -rt_sigpending, -rt_sigprocmask, -rt_sigqueueinfo, -rt_sigreturn, -rt_sigsuspend, -rt_sigtimedwait, -sched_\%get_\%priority_max(2), -sched_\%get_\%priority_min(2), -sched_\%get\%param(2), -sched_\%get\%scheduler(2), -sched_\%rr_\%get_\%interval(2), -sched_\%set\%param(2), -sched_\%set\%scheduler(2), -sched_\%yield(2), -security, -select(2), -sendfile(2), -send(2), sendmsg(2), sendto(2), -set\%domainname(2), -set\%fsgid(2), set\%fsgid32, -set\%fsuid(2), set\%fsuid32, -set\%gid(2), set\%gid32, -set\%groups(2), set\%groups32, -set\%hostname(2), -set\%itimer(2), -set\%pgid(2), -set\%priority(2), -set\%regid(2), set\%regid32, -set\%resgid(2), set\%resgid32, -set\%resuid(2), set\%resuid32, -set\%reuid(2), set\%reuid32, -set\%rlimit(2), -set\%sid(2), -set\%sockopt(2), -set\%timeofday(2), -set\%uid(2), set\%uid32, -setup(2), -sgetmask(2), -shutdown(2), -sigaction(2), -sigaltstack(2), -signal(2), -sigpending(2), -sigprocmask(2), -sigreturn(2), -sigsuspend(2), -socket(2), -socketcall(2), -socketpair(2), -ssetmask(2), -stat(2), stat64, -statfs(2), -stime(2), -stty, -swapoff(2), -swapon(2), -symlink(2), -sync(2), -sysfs(2), -sysinfo(2), -syslog(2), -time(2), -times(2), -truncate(2), truncate64, -ulimit, -umask(2), -umount(2), -uname(2), -unlink(2), -uselib(2), -ustat(2), -utime(2), -vfork(2), -vhangup(2), -vm86(2), -vm86old, -wait4(2), -waitpid(2), -write(2), -writev(2). - -Of the above, 9 are obsolete, namely -getrlimit, oldfstat, oldlstat, oldolduname, oldstat, olduname, -readdir, select and vm86old +This man page lists those system calls that are common to most platforms. +In the list, the +.I 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: +.IP * 3 +Where no kernel version is indicated, +the system call appeared in kernel 2.0 or earlier. +.IP * +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. +(No new system calls were added in the stable +kernel 2.0.x series. +The 2.2 kernel was created as a branch of kernel 2.0.21 via the 2.1.x +unstable kernel series) +.IP * +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. +(No new system calls were added in the stable +kernel 2.2.x series. +The 2.4 kernel was created as a branch of kernel 2.2.8 via the 2.3.x +unstable kernel series.) +.IP * +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. +.IP * +Starting with kernel 2.6.0, the development model changed, +and new system calls may appear in each 2.6.x release. +Kernel 2.6.0 was formed from a branch of kernel 2.4.15 via the 2.5.x +unstable kernel series. +In some cases, a system call appeared in 2.6.x and was also backported +into a 2.4.x release after 2.4.15; +where this is so, the version where the system call appeared +in both of the major kernel series is listed. +(Where a system call is listed as appearing in kernel 2.4.x, x <= 15, +then implicitly it also appeared in the later kernel 2.6.0.) +.PP +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: +.\" +.\" Looking at scripts/checksyscalls.sh in the kernel source is +.\" instructive about i386 specifics. +.\" +.TS +l l l +--- +l l l. +System call Kernel Notes +\fB_llseek\fP(2) +\fB_newselect\fP(2) +\fB_sysctl\fP(2) +\fBaccept\fP(2) +\fBaccess\fP(2) +\fBacct\fP(2) +\fBadd_key\fP(2) 2.6.11 +\fBadjtimex\fP(2) +\fBafs_syscall\fP(2) +\fBalarm\fP(2) +.\" alloc_hugepages (2) appeared in 2.5.36 and went away in 2.5.44 +.\" in 2.4.x, the syscall number exists but give ENOSYS +\fBbdflush\fP(2) +\fBbind\fP(2) +\fBbreak\fP(2) +\fBbrk\fP(2) +\fBcacheflush\fP(2) Various architectures; + but not on i386 +\fBcapget\fP(2) 2.2 +\fBcapset\fP(2) 2.2 +\fBchdir\fP(2) +\fBchmod\fP(2) +\fBchown\fP(2) +\fBchown32\fP(2) 2.4 +\fBchroot\fP(2) +\fBclock_getres\fP(2) 2.6 +\fBclock_gettime\fP(2) 2.6 +\fBclock_nanosleep\fP(2) 2.6 +\fBclock_settime\fP(2) 2.6 +\fBclone\fP(2) +\fBclose\fP(2) +\fBconnect\fP(2) +\fBcreat\fP(2) +\fBcreate_module\fP(2) +\fBdelete_module\fP(2) +\fBdup\fP(2) +\fBdup2\fP(2) +\fBepoll_create\fP(2) 2.6 +\fBepoll_ctl\fP(2) 2.6 +\fBepoll_pwait\fP(2) 2.6.19 +\fBepoll_wait\fP(2) 2.6 +\fBeventfd\fP(2) 2.6.22 +\fBexecve\fP(2) +\fBexit\fP(2) +\fBexit_group\fP(2) 2.6; 2.4.20 +\fBfaccessat\fP(2) 2.6.16 +\fBfadvise64\fP(2) 2.6 Implements \fBposix_fadvise\fP(2) +\fBfadvise64_64\fP(2) 2.6 Implements \fBposix_fadvise\fP(2) +\fBfchdir\fP(2) +\fBfchmod\fP(2) +\fBfchmodat\fP(2) 2.6.16 +\fBfchown\fP(2) +\fBfchown32\fP(2) 2.4 +\fBfchownat\fP(2) 2.6.16 +\fBfcntl\fP(2) +\fBfcntl64\fP(2) 2.4 +\fBfdatasync\fP(2) +\fBfgetxattr\fP(2) 2.6; 2.4.18 +\fBflistxattr\fP(2) 2.6; 2.4.18 +\fBflock\fP(2) +\fBfork\fP(2) +.\" free_hugepages (2) appeared in 2.5.36 and went away in 2.5.44 +.\" in 2.4.x, the syscall number exists but give ENOSYS +\fBfremovexattr\fP(2) 2.6; 2.4.18 +\fBfsetxattr\fP(2) 2.6; 2.4.18 +\fBfstat\fP(2) +\fBfstat64\fP(2) 2.4 +\fBfstatat64\fP(2) 2.6.16? +\fBfstatfs\fP(2) +\fBfstatfs64\fP(2) 2.6 +\fBfsync\fP(2) +\fBftime\fP(2) Implemented in glibc; + see \fBftime\fP(3) +\fBftruncate\fP(2) +\fBftruncate64\fP(2) 2.4 +\fBfutex\fP(2) 2.6; 2.4.19 +\fBfutimesat\fP(2) 2.6.16 +\fBget_kernel_syms\fP(2) +\fBget_mempolicy\fP(2) 2.6.6 +\fBget_robust_list\fP(2) 2.6.17 +\fBget_thread_area\fP(2) 2.6; 2.4.20 +\fBgetcpu\fP(2) 2.6.19 +\fBgetcwd\fP(2) 2.2 +\fBgetdents\fP(2) +\fBgetdents64\fP(2) 2.4 +\fBgetegid\fP(2) +\fBgetegid32\fP(2) 2.4 +\fBgeteuid\fP(2) +\fBgeteuid32\fP(2) 2.4 +\fBgetgid\fP(2) +\fBgetgid32\fP(2) 2.4 +\fBgetgroups\fP(2) +\fBgetgroups32\fP(2) 2.4 +\fBgetitimer\fP(2) +\fBgetpeername\fP(2) +\fBgetpagesize\fP(2) Various architectures; + but not on i386 +\fBgetpgid\fP(2) +\fBgetpgrp\fP(2) +\fBgetpid\fP(2) +\fBgetpmsg\fP(2) 2.2 Reserved for STREAMS support +\fBgetppid\fP(2) +\fBgetpriority\fP(2) +\fBgetresgid\fP(2) 2.2 +\fBgetresgid32\fP(2) 2.4 +\fBgetresuid\fP(2) 2.2 +\fBgetresuid32\fP(2) 2.4 +\fBgetrlimit\fP(2) +\fBgetrusage\fP(2) +\fBgetsid\fP(2) +\fBgetsockname\fP(2) +\fBgetsockopt\fP(2) +\fBgettid\fP(2) 2.4.11 +\fBgettimeofday\fP(2) +\fBgetuid\fP(2) +\fBgetuid32\fP(2) 2.4 +\fBgetxattr\fP(2) 2.6; 2.4.18 +\fBgtty\fP(2) +\fBidle\fP(2) +\fBinit_module\fP(2) +\fBinotify_add_watch\fP(2) 2.6.13 +\fBinotify_init\fP(2) 2.6.13 +\fBinotify_rm_watch\fP(2) 2.6.13 +\fBio_cancel\fP(2) 2.6; 2.4.20 +\fBio_destroy\fP(2) 2.6; 2.4.20 +\fBio_getevents\fP(2) 2.6; 2.4.20 +\fBio_setup\fP(2) 2.6; 2.4.20 +\fBio_submit\fP(2) 2.6; 2.4.20 +\fBioctl\fP(2) +\fBioperm\fP(2) +\fBiopl\fP(2) +\fBioprio_get\fP(2) 2.6.13 +\fBioprio_set\fP(2) 2.6.13 +\fBipc\fP(2) Implements System V IPC calls +\fBkexec_load\fP(2) 2.6.7 Was named sys_kexec_load() + from 2.6.7 to 2.6.16 +\fBkeyctl\fP(2) 2.6.11 +\fBkill\fP(2) +\fBlchown\fP(2) 2.2 +\fBlchown32\fP(2) 2.4 +\fBlgetxattr\fP(2) 2.6; 2.4.18 +\fBlink\fP(2) +\fBlinkat\fP(2) 2.6.16 +\fBlisten\fP(2) +\fBlistxattr\fP(2) 2.6; 2.4.18 +\fBllistxattr\fP(2) 2.6; 2.4.18 +\fBlock\fP(2) +\fBlookup_dcookie\fP(2) 2.6 +\fBlremovexattr\fP(2) 2.6; 2.4.18 +\fBlseek\fP(2) +\fBlsetxattr\fP(2) 2.6; 2.4.18 +\fBlstat\fP(2) +\fBlstat64\fP(2) 2.4 +\fBmadvise\fP(2) 2.4 +\fBmadvise1\fP(2) 2.4 +\fBmbind\fP(2) 2.6.6 +.\" \fBmemory_ordering\fP(2) ??? Sparc64 +\fBmigrate_pages\fP(2) 2.6.16 +\fBmincore\fP(2) 2.4 +\fBmkdir\fP(2) +\fBmkdirat\fP(2) 2.6.16 +\fBmknod\fP(2) +\fBmknodat\fP(2) 2.6.16 +\fBmlock\fP(2) +\fBmlockall\fP(2) +\fBmmap\fP(2) +\fBmmap2\fP(2) 2.4 +\fBmodify_ldt\fP(2) +\fBmount\fP(2) +\fBmove_pages\fP(2) 2.6.18 +\fBmprotect\fP(2) +\fBmpx\fP(2) +\fBmq_getsetattr\fP(2) 2.6.6 Implements \fBmq_getattr\fP(3) + and \fBmq_setattr\fP(3) +\fBmq_notify\fP(2) 2.6.6 +\fBmq_open\fP(2) 2.6.6 +\fBmq_timedreceive\fP(2) 2.6.6 +\fBmq_timedsend\fP(2) 2.6.6 +\fBmq_unlink\fP(2) +\fBmremap\fP(2) +\fBmsgctl\fP(2) +\fBmsgget\fP(2) +\fBmsgrcv\fP(2) +\fBmsgsnd\fP(2) +\fBmsync\fP(2) +\fBmunlock\fP(2) +\fBmunlockall\fP(2) +\fBmunmap\fP(2) +\fBnanosleep\fP(2) +\fBnfsservctl\fP(2) 2.2 +\fBnice\fP(2) +\fBoldfstat\fP(2) +\fBoldlstat\fP(2) +\fBoldolduname\fP(2) +\fBoldstat\fP(2) +\fBolduname\fP(2) +\fBopen\fP(2) +\fBopenat\fP(2) 2.6.16 +\fBpause\fP(2) +.\" \fBpciconfig_iobase\fP(2) ??? Alpha, PowerPC, ARM +.\" \fBpciconfig_read\fP(2) ??? Alpha, PowerPC, ARM +.\" \fBpciconfig_write\fP(2) ??? Alpha, PowerPC, ARM +\fBpersonality\fP(2) +.\" \fBperfctr\fP(2) ??? Sparc32, Sparc64 +.\" \fBperfmonctl\fP(2) ??? IA-64 +\fBphys\fP(2) Unimplemented (no slot + since 2.1.116) +\fBpipe\fP(2) +\fBpivot_root\fP(2) 2.5 +\fBpoll\fP(2) 2.2 +\fBppoll\fP(2) 2.6.16 +\fBprctl\fP(2) 2.2 +\fBpread64\fP(2) Added as "pread" in 2.2; + renamed "pread64" in 2.6 +\fBprof\fP(2) +\fBprofil\fP(2) Implemented in glibc; + see \fBprofil\fP(3) +\fBpselect6\fP(2) 2.6.16 Implements \fBpselect\fP(2) +\fBptrace\fP(2) +\fBputpmsg\fP(2) 2.2 Reserved for STREAMS support +\fBpwrite64\fP(2) Added as "pwrite" in 2.2; + renamed "pwrite64" in 2.6 +\fBquery_module\fP(2) 2.2 +\fBquotactl\fP(2) +\fBread\fP(2) +\fBreadahead\fP(2) 2.4.13 +\fBreaddir\fP(2) Superseded by \fBgetdents\fP(2) +\fBreadlink\fP(2) +\fBreadlinkat\fP(2) 2.6.16 +\fBreadv\fP(2) +\fBreboot\fP(2) +\fBrecv\fP(2) +\fBrecvfrom\fP(2) +\fBrecvmsg\fP(2) +\fBremap_file_pages\fP(2) 2.6 +\fBremovexattr\fP(2) 2.6; 2.4.18 +\fBrename\fP(2) +\fBrenameat\fP(2) 2.6.16 +\fBrequest_key\fP(2) 2.6.11 +\fBrestart_syscall\fP(2) 2.6 +\fBrmdir\fP(2) +\fBrt_sigaction\fP(2) 2.2 +\fBrt_sigpending\fP(2) 2.2 +\fBrt_sigprocmask\fP(2) 2.2 +\fBrt_sigqueueinfo\fP(2) 2.2 Implements \fBsigqueue\fP(2) +\fBrt_sigreturn\fP(2) 2.2 +\fBrt_sigsuspend\fP(2) 2.2 +\fBrt_sigtimedwait\fP(2) 2.2 +\fBsched_get_priority_max\fP(2) +\fBsched_get_priority_min\fP(2) +\fBsched_getaffinity\fP(2) 2.6; 2.4.19 +\fBsched_getparam\fP(2) +\fBsched_getscheduler\fP(2) +\fBsched_rr_get_interval\fP(2) +\fBsched_setaffinity\fP(2) 2.6; 2.4.19 +\fBsched_setparam\fP(2) +\fBsched_setscheduler\fP(2) +\fBsched_yield\fP(2) +.\" 2.4.11 added security(2), but this was dropped in 2.5.x +.\" \fBsecurity\fP(2) +.\" (2.4.11; not in 2.6) +\fBselect\fP(2) +\fBsemctl\fP(2) +\fBsemget\fP(2) +\fBsemop\fP(2) +\fBsemtimedop\fP(2) 2.6; 2.4.22 +\fBsend\fP(2) +\fBsendfile\fP(2) 2.2 +\fBsendfile64\fP(2) 2.6; 2.4.19 +\fBsendmsg\fP(2) +\fBsendto\fP(2) +\fBset_mempolicy\fP(2) 2.6.6 +\fBset_robust_list\fP(2) 2.6.17 +\fBset_thread_area\fP(2) 2.6; 2.4.20 +\fBset_tid_address\fP(2) 2.6 +\fBset_zone_reclaim\fP(2) 2.6.13 Removed in 2.6.16 +\fBsetdomainname\fP(2) +\fBsetfsgid\fP(2) +\fBsetfsgid32\fP(2) 2.4 +\fBsetfsuid\fP(2) +\fBsetfsuid32\fP(2) 2.4 +\fBsetgid\fP(2) +\fBsetgid32\fP(2) 2.4 +\fBsetgroups\fP(2) +\fBsetgroups32\fP(2) 2.4 +\fBsethostname\fP(2) +\fBsetitimer\fP(2) +\fBsetpgid\fP(2) +\fBsetpriority\fP(2) +\fBsetregid\fP(2) +\fBsetregid32\fP(2) 2.4 +\fBsetresgid\fP(2) 2.2 +\fBsetresgid32\fP(2) 2.4 +\fBsetresuid\fP(2) 2.2 +\fBsetresuid32\fP(2) 2.4 +\fBsetreuid\fP(2) +\fBsetreuid32\fP(2) 2.4 +\fBsetrlimit\fP(2) +\fBsetsid\fP(2) +\fBsetsockopt\fP(2) +\fBsettimeofday\fP(2) +\fBsetuid\fP(2) +\fBsetuid32\fP(2) 2.4 +\fBsetup\fP(2) Removed in 2.2 +\fBsetxattr\fP(2) 2.6; 2.4.18 +\fBsgetmask\fP(2) +\fBshmat\fP(2) +\fBshmctl\fP(2) +\fBshmdt\fP(2) +\fBshmget\fP(2) +\fBshutdown\fP(2) +\fBsigaction\fP(2) +\fBsigaltstack\fP(2) 2.2 +\fBsignal\fP(2) +\fBsignalfd\fP(2) 2.6.22 +\fBsigpending\fP(2) +\fBsigprocmask\fP(2) +\fBsigreturn\fP(2) +\fBsigsuspend\fP(2) +\fBsocket\fP(2) +\fBsocketcall\fP(2) Implements BSD socket calls +\fBsocketpair\fP(2) +\fBsplice\fP(2) 2.6.17 +.\" \fBspu_create\fP(2) 2.6.16 PowerPC only +.\" \fBspu_run\fP(2) 2.6.16 PowerPC only +\fBssetmask\fP(2) +\fBstat\fP(2) +\fBstat64\fP(2) 2.4 +\fBstatfs\fP(2) +\fBstatfs64\fP(2) 2.6 +\fBstime\fP(2) +\fBstty\fP(2) +\fBswapoff\fP(2) +\fBswapon\fP(2) +\fBsymlink\fP(2) +\fBsymlinkat\fP(2) 2.6.16 +\fBsync\fP(2) +\fBsync_file_range\fP(2) 2.6.17 +\fBsysfs\fP(2) +\fBsysinfo\fP(2) +\fBsyslog\fP(2) glibc interface is \fBklogctl\fP(3) +\fBtee\fP(2) 2.6.17 +\fBtgkill\fP(2) 2.6 +\fBtime\fP(2) +\fBtimer_create\fP(2) 2.6 +\fBtimer_delete\fP(2) 2.6 +\fBtimer_getoverrun\fP(2) 2.6 +\fBtimer_gettime\fP(2) 2.6 +\fBtimer_settime\fP(2) 2.6 +\fBtimerfd\fP(2) 2.6.22 +\fBtimes\fP(2) +\fBtkill\fP(2) 2.6; 2.4.22 +\fBtruncate\fP(2) +\fBtruncate64\fP(2) 2.4 +\fBugetrlimit\fP(2) 2.4 +\fBulimit\fP(2) Implemented in glibc; + see \fBulimit\fP(3) +\fBumask\fP(2) +\fBumount\fP(2) +.\" sys_oldumount() -- __NR_umount +\fBumount2\fP(2) 2.2 +.\" sys_umount() -- __NR_umount2 +\fBuname\fP(2) +\fBunlink\fP(2) +\fBunlinkat\fP(2) 2.6.16 +\fBunshare\fP(2) 2.6.16 +\fBuselib\fP(2) +\fBustat\fP(2) +\fButime\fP(2) +\fButimensat\fP(2) 2.6.22 +\fButimes\fP(2) 2.6 +\fBvfork\fP(2) +\fBvhangup\fP(2) +\fBvm86old\fP(2) Superseded by \fBvm86\fP() +\fBvmsplice\fP(2) 2.6.17 +\fBvserver\fP(2) 2.6 +\fBwait4\fP(2) +\fBwaitid\fP(2) 2.6.10 +\fBwaitpid\fP(2) +\fBwrite\fP(2) +\fBwritev\fP(2) +.TE +.PP +Note the following points: +.\" .IP * 3 +.\" These system calls are obsolete: +.\" getrlimit, +.\" .\" .\" oldfstat, +.\" .\" .\" oldlstat, +.\" .\" .\" oldolduname, +.\" .\" .\" oldstat, +.\" .\" .\" olduname, +.\" .\" .\" readdir, +.\" .\" .\" select, +.\" .\" .\" and +.\" .\" .\" vm86old +.IP * 3 +Although slots are reserved for them in the system call table, +the following system calls are not implemented in the standard kernel: +.BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386 +.BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386 +.BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386 +.BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386 +.BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386 +.BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386 +.BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386 +.BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386 +.BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386 +.BR phys (2), \" Slot has been re-used +.BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386 +.BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386 +.BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386 +.BR security (2), +.\" __NR_putpmsg is 223 on Linux 2.4/i386; absent on 2.6/i386, present +.\" on a a couple og 2.6 architectures +.BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386 +.BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386 +and +.BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 (see also -.BR obsolete (2)), -and 15 are unimplemented in the standard kernel, namely -afs_syscall, break, ftime, getpmsg, gtty, idle, lock, mpx, phys, -prof, profil, putpmsg, security, stty and ulimit (see also .BR unimplemented (2)). However, .BR ftime (3), @@ -258,13 +515,21 @@ However, and .BR ulimit (3) exist as library routines. -The slot for phys is in use since 2.1.116 for umount; -phys will never be implemented. -The getpmsg and putpmsg calls are for -kernels patched to support streams, and may never be in the standard -kernel. -The security call is for future use. - +The slot for +.BR phys (2) +is in use since kernel 2.1.116 for +.BR umount (2); +.BR phys (2) +will never be implemented. +.IP * +The +.BR getpmsg (2) +and +.BR putpmsg (2) +calls are for kernels patched to support STREAMS, +and may never be in the standard kernel. +.\" The security call is for future use. +.PP Roughly speaking, the code belonging to the system call with number __NR_xxx defined in .I /usr/include/asm/unistd.h @@ -279,52 +544,169 @@ 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. -Below the details for Linux 2.4.17. -The defines __NR_oldstat and __NR_stat refer to the routines -sys_stat() and sys_newstat(), and similarly for -.I fstat +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 multiple implementations +of certain system calls. +These different versions are incompatible at the binary level, +but applications are generally unaware of this: glibc does some magic +to ensure that existing binaries use the version of the system +call that was current when the binary was created, +so that ABI compatibility is preserved. +Examples of systems calls that exist in multiple versions are +the following: +.IP * 3 +By now there are three different implementations of +.BR stat (2): +.IR sys_stat () +(slot +.IR __NR_oldstat ), +.IR sys_newstat () +(slot +.IR __NR_stat ), and -.IR lstat . -Similarly, 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 -version of the system call, and the older ones are for backward -compatibility. - +.IR sys_stat64() +(slot +.IR __NR_stat64 ), +with the last being the most current. +.\" e.g., on 2.6.22/x86: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195 +.\" The stat system calls deal with three different data structures, +.\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64 +A similar story applies for +.BR lstat (2) +and +.BR fstat (2). +.IP * +Similarly, the defines +.IR __NR_oldolduname , +.IR __NR_olduname , +and +.IR __NR_uname +refer to the routines +.IR sys_olduname (), +.IR sys_uname () +and +.IR sys_newuname (). +.IP * +In Linux 2.0, +a new version of +.BR vm86 (2) +appeared, with the old and the new kernel routines being named +.IR sys_vm86old () +and +.IR sys_vm86 (). +.IP * +In Linux 2.4, +a new version of +.BR getrlimit (2) +appeared, with the old and the new kernel routines being named +.IR sys_old_getrlimit () +(slot +.IR __NR_getrlimit ) +and +.IR sys_getrlimit () +(slot +.IR __NR_ugetrlimit ). +.IP * +Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. +.\" 64 bit off_t changes: ftruncate64, *stat64, +.\" fcntl64 (because of the flock structure), getdents64, *statfs64 +To support this change, a range of system calls were added +(e.g., +.BR chown32 (2), +.BR getuid32 (2), +.BR getgroups32 (2), +.BR setresuid32 (2)), +superseding earlier calls of the same name without the +"32" suffix. +.IP * +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, replacements were required for system calls +that deal with file offsets and sizes. +Thus the following system calls were added: +.BR fcntl64 (2), +.BR ftruncate64 (2), +.BR getdents64 (2), +.BR stat64 (2), +.BR 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" suffix. +.sp +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. +.IP * +The +.I rt_sig* +calls were added in kernel 2.2 to support the addition +of real-time signals (see +.BR signal (7)). +These system calls supersede the older system calls of the same +name without the "rt_" prefix. +.IP * It is different with -.I select +.B select (2) and -.IR mmap . +.BR mmap (2). These use five or more parameters, 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 +other architectures have +.IR sys_select () +and +.IR sys_mmap () +corresponding to +.IR __NR_select +and +.IR __NR_mmap , +on i386 one finds +.IR old_select () +and +.IR 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(). +is not a problem any more, and there is a +.IR __NR__newselect +(used by +libc 6) that corresponds directly to +.IR sys_select () +and similarly +.IR __NR_mmap2. +.PP +Two system call numbers, +.IR __NR__llseek +and +.IR __NR__sysctl +have an additional underscore absent in +.IR sys_llseek () +and +.IR sys_sysctl (). On many platforms, including i386, socket calls are all multiplexed -through socketcall() and System V IPC calls through ipc(). +through +.BR socketcall (2) +and System V IPC calls are multiplexed through +.BR 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 -getrlimit and mmap, and the new calls pivot_root, mincore, madvise, -security, gettid and readahead. +In kernel 2.1.81, +.BR lchown (2) +and +.BR chown (2) +were swapped; that is, +.BR lchown (2) +was added with the semantics that were then current for +.BR chown (2), +and the semantics of the latter call were changed to what +they are today. +.SH SEE ALSO +.BR syscall (2), +.BR unimplemented (2)