]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/syscalls.2
Added FIXMEs.
[thirdparty/man-pages.git] / man2 / syscalls.2
CommitLineData
fea681da
MK
1.\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl)
2.\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern
3.\" <redferni@logica.com>
4.\"
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
13.\"
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
24.\"
d9343c5c 25.TH SYSCALLS 2 2002-01-07 "Linux" "Linux Programmer's Manual"
fea681da
MK
26.SH NAME
27none \- list of all system calls
28.SH SYNOPSIS
29Linux 2.4 system calls.
30.SH DESCRIPTION
31The system call is the fundamental interface between an application
c13182ef
MK
32and the Linux kernel.
33As of Linux 2.4.17, there are 1100 system calls
fea681da
MK
34listed in
35.IR /usr/src/linux/include/asm-*/unistd.h .
1fb8c49b 36This man page lists those that are common to most platforms.
fea681da
MK
37
38_llseek(2),
39_newselect(2),
40_sysctl(2),
41accept(2),
42access(2),
43acct(2),
44adjtimex(2),
45afs_syscall,
46alarm(2),
47bdflush(2),
48bind(2),
49break,
50brk(2),
51cacheflush(2),
52capget(2),
53capset(2),
54chdir(2),
55chmod(2),
56chown(2), chown32,
57chroot(2),
58clone(2),
59close(2),
60connect(2),
61creat(2),
62create_module(2),
63delete_module(2),
64dup(2),
65dup2(2),
66execve(2),
67exit(2),
68fchdir(2),
69fchmod(2),
70fchown(2), fchown32,
71fcntl(2), fcntl64,
72fdatasync(2),
73flock(2),
74fork(2),
75fstat(2), fstat64,
76fstatfs(2),
77fsync(2),
78ftime,
79ftruncate(2), ftruncate64,
80get\%_kernel\%_syms(2),
81get\%cwd(2),
82get\%dents(2), get\%dents64,
83get\%egid(2), get\%egid32,
84get\%euid(2), get\%euid32,
85get\%gid(2), get\%gid32,
86get\%groups(2), get\%groups32,
87get\%itimer(2),
88get\%pagesize(2),
89get\%peername(2),
90get\%pmsg,
91get\%pgid(2),
92get\%pgrp(2),
93get\%pid(2),
94get\%ppid(2),
95get\%priority(2),
96get\%resgid(2), get\%resgid32,
97get\%resuid(2), get\%resuid32,
98get\%rlimit(2),
99get\%rusage(2),
100get\%sid(2),
101get\%sockname(2),
102get\%sockopt(2),
103get\%tid,
104get\%timeofday(2),
105get\%uid(2), get\%uid32,
106gtty,
107idle,
108init_module(2),
109ioctl(2),
110io\%perm(2),
111iopl(2),
112ipc(2),
113kill(2),
114lchown(2), lchown32,
115link(2),
116listen(2),
117lock,
118lseek(2),
119lstat(2), lstat64,
120madvise(2),
121mincore(2),
122mkdir(2),
123mknod(2),
124mlock(2),
125mlockall(2),
126mmap(2),
127modify_ldt(2),
128mount(2),
129mprotect(2),
130mpx,
131mremap(2),
132msync(2),
133munlock(2),
134munlockall(2),
135munmap(2),
136nanosleep(2),
137nfsservctl(2),
138nice(2),
139oldfstat, oldlstat, oldolduname, oldstat, oldumount, olduname,
140open(2),
141pause(2),
142personality(2),
143phys,
144pipe(2),
145pivot_root(2),
146poll(2),
147prctl(2),
148pread(2),
149prof, profil,
150ptrace(2),
151putpmsg,
152pwrite(2),
153query_module(2),
154quotactl(2),
155read(2),
156readahead,
157readdir(2),
158readlink(2),
159readv(2),
160reboot(2),
161recv(2), recvfrom(2), recvmsg(2),
162rename(2),
163rmdir(2),
164rt_sigaction,
165rt_sigpending,
166rt_sigprocmask,
167rt_sigqueueinfo,
168rt_sigreturn,
169rt_sigsuspend,
170rt_sigtimedwait,
171sched_\%get_\%priority_max(2),
172sched_\%get_\%priority_min(2),
173sched_\%get\%param(2),
174sched_\%get\%scheduler(2),
175sched_\%rr_\%get_\%interval(2),
176sched_\%set\%param(2),
177sched_\%set\%scheduler(2),
178sched_\%yield(2),
179security,
180select(2),
181sendfile(2),
182send(2), sendmsg(2), sendto(2),
183set\%domainname(2),
184set\%fsgid(2), set\%fsgid32,
185set\%fsuid(2), set\%fsuid32,
186set\%gid(2), set\%gid32,
187set\%groups(2), set\%groups32,
188set\%hostname(2),
189set\%itimer(2),
190set\%pgid(2),
191set\%priority(2),
192set\%regid(2), set\%regid32,
193set\%resgid(2), set\%resgid32,
194set\%resuid(2), set\%resuid32,
195set\%reuid(2), set\%reuid32,
196set\%rlimit(2),
197set\%sid(2),
198set\%sockopt(2),
199set\%timeofday(2),
200set\%uid(2), set\%uid32,
201setup(2),
202sgetmask(2),
203shutdown(2),
204sigaction(2),
205sigaltstack(2),
206signal(2),
207sigpending(2),
208sigprocmask(2),
209sigreturn(2),
210sigsuspend(2),
211socket(2),
212socketcall(2),
213socketpair(2),
214ssetmask(2),
215stat(2), stat64,
216statfs(2),
217stime(2),
218stty,
219swapoff(2),
220swapon(2),
221symlink(2),
222sync(2),
223sysfs(2),
224sysinfo(2),
225syslog(2),
226time(2),
227times(2),
228truncate(2), truncate64,
229ulimit,
230umask(2),
231umount(2),
232uname(2),
233unlink(2),
234uselib(2),
235ustat(2),
236utime(2),
237vfork(2),
238vhangup(2),
239vm86(2),
240vm86old,
241wait4(2),
242waitpid(2),
243write(2),
244writev(2).
245
246Of the above, 9 are obsolete, namely
247getrlimit, oldfstat, oldlstat, oldolduname, oldstat, olduname,
248readdir, select and vm86old
249(see also
250.BR obsolete (2)),
251and 15 are unimplemented in the standard kernel, namely
252afs_syscall, break, ftime, getpmsg, gtty, idle, lock, mpx, phys,
253prof, profil, putpmsg, security, stty and ulimit (see also
254.BR unimplemented (2)).
255However,
256.BR ftime (3),
257.BR profil (3)
258and
259.BR ulimit (3)
260exist as library routines.
261The slot for phys is in use since 2.1.116 for umount;
c13182ef
MK
262phys will never be implemented.
263The getpmsg and putpmsg calls are for
fea681da 264kernels patched to support streams, and may never be in the standard
c13182ef
MK
265kernel.
266The security call is for future use.
fea681da
MK
267
268Roughly speaking, the code belonging to the system call
269with number __NR_xxx defined in
270.I /usr/include/asm/unistd.h
271can be found in the kernel source in the routine
63aa9df0 272.IR sys_xxx ().
fea681da
MK
273(The dispatch table for i386 can be found in
274.IR /usr/src/linux/arch/i386/kernel/entry.S .)
275There are many exceptions, however, mostly because
276older system calls were superseded by newer ones,
c13182ef
MK
277and this has been treated somewhat unsystematically.
278On platforms with
fea681da
MK
279proprietary OS emulation, such as parisc, sparc, sparc64 and alpha,
280there are many additional system calls; mips64 also contains a full
281set of 32-bit system calls.
282Below the details for Linux 2.4.17.
283
284The defines __NR_oldstat and __NR_stat refer to the routines
285sys_stat() and sys_newstat(), and similarly for
286.I fstat
287and
288.IR lstat .
289Similarly, the defines __NR_oldolduname, __NR_olduname and
290__NR_uname refer to the routines sys_olduname(), sys_uname()
291and sys_newuname().
292Thus, __NR_stat and __NR_uname have always referred to the latest
293version of the system call, and the older ones are for backward
294compatibility.
295
296It is different with
297.I select
298and
299.IR mmap .
300These use five or more parameters, and caused problems the way
c13182ef
MK
301parameter passing on the i386 used to be set up.
302Thus, while
fea681da
MK
303other architectures have sys_select() and sys_mmap() corresponding
304to __NR_select and __NR_mmap, on i386 one finds old_select()
305and old_mmap() (routines that use a pointer to a
c13182ef
MK
306parameter block) instead.
307These days passing five parameters
fea681da
MK
308is not a problem any more, and there is a __NR__newselect (used by
309libc 6) that corresponds directly to sys_select() and similarly __NR_mmap2.
310
311Two other system call numbers, __NR__llseek and __NR__sysctl
312have an additional underscore absent in sys_llseek() and sys_sysctl().
313
314Then there is __NR_readdir corresponding to old_readdir(),
315which will read at most one directory entry at a time, and is
316superseded by sys_getdents().
317
318On many platforms, including i386, socket calls are all multiplexed
319through socketcall() and System V IPC calls through ipc().
320
321On newer platforms that only have 64-bit file access and 32-bit uids
75b94dc3 322(e.g., alpha, ia64, s390x) there are no *64 or *32 calls.
c13182ef 323Where the *64
fea681da
MK
324and *32 calls exist, the other versions are obsolete.
325
c13182ef
MK
326The chown and lchown system calls were swapped in 2.1.81.
327The *64 and
fea681da
MK
328*32 calls were added for kernel 2.4, as were the new versions of
329getrlimit and mmap, and the new calls pivot_root, mincore, madvise,
330security, gettid and readahead.