diff options
Diffstat (limited to 'man2/syscalls.2')
-rw-r--r-- | man2/syscalls.2 | 323 |
1 files changed, 323 insertions, 0 deletions
diff --git a/man2/syscalls.2 b/man2/syscalls.2 new file mode 100644 index 000000000..1fc0af027 --- /dev/null +++ b/man2/syscalls.2 @@ -0,0 +1,323 @@ +.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) +.\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern +.\" <redferni@logica.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" 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 2.4" "Linux Programmer's Manual" +.SH NAME +none \- list of all system calls +.SH SYNOPSIS +Linux 2.4 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 +(providing hyperlinks if you read this with a browser). + +_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 +(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), +.BR profil (3) +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. + +Roughly speaking, the code belonging to the system call +with number __NR_xxx defined in +.I /usr/include/asm/unistd.h +can be found in the kernel source in the routine +.IR sys_xxx() . +(The dispatch table for i386 can be found in +.IR /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 unsystematically. 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 +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. + +It is different with +.I select +and +.IR mmap . +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 +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() and System V IPC calls through ipc(). + +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. |