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