]>
Commit | Line | Data |
---|---|---|
c11b1abf | 1 | .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com> |
09de4bf1 MK |
2 | .\" with some input from Stepan Kasal <kasal@ucw.cz> |
3 | .\" | |
4 | .\" Some content retained from an earlier version of this page: | |
fea681da MK |
5 | .\" Copyright (C) 1998 Andries Brouwer (aeb@cwi.nl) |
6 | .\" Modifications for 2.2 and 2.4 Copyright (C) 2002 Ian Redfern | |
7 | .\" <redferni@logica.com> | |
8 | .\" | |
9 | .\" Permission is granted to make and distribute verbatim copies of this | |
10 | .\" manual provided the copyright notice and this permission notice are | |
11 | .\" preserved on all copies. | |
12 | .\" | |
13 | .\" Permission is granted to copy and distribute modified versions of this | |
14 | .\" manual under the conditions for verbatim copying, provided that the | |
15 | .\" entire resulting derived work is distributed under the terms of a | |
16 | .\" permission notice identical to this one. | |
17 | .\" | |
18 | .\" Since the Linux kernel and libraries are constantly changing, this | |
19 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
20 | .\" responsibility for errors or omissions, or for damages resulting from | |
21 | .\" the use of the information contained herein. The author(s) may not | |
22 | .\" have taken the same level of care in the production of this manual, | |
23 | .\" which is licensed free of charge, as they might when working | |
24 | .\" professionally. | |
25 | .\" | |
26 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
27 | .\" the source, must acknowledge the copyright and authors of this work. | |
28 | .\" | |
4731cd2e | 29 | .TH SYSCALLS 2 2008-04-29 "Linux" "Linux Programmer's Manual" |
fea681da | 30 | .SH NAME |
09de4bf1 | 31 | syscalls \- Linux system calls |
fea681da | 32 | .SH SYNOPSIS |
09de4bf1 | 33 | Linux system calls. |
fea681da MK |
34 | .SH DESCRIPTION |
35 | The system call is the fundamental interface between an application | |
c13182ef | 36 | and the Linux kernel. |
7d50a840 MK |
37 | .SS System calls and library wrapper functions |
38 | System calls are generally not invoked directly, | |
61d7d93c MK |
39 | but rather via wrapper functions in glibc (or perhaps some other library). |
40 | For details of direct invocation of a system call, see | |
41 | .BR intro (2). | |
7d50a840 MK |
42 | Often, but not always, the name of the wrapper function is the same |
43 | as the name of the system call that it invokes. | |
44 | For example, glibc contains a function | |
45 | .BR truncate () | |
46 | which invokes the underlying "truncate" system call. | |
fea681da | 47 | |
7d50a840 MK |
48 | Often the glibc wrapper function is quite thin, doing little work |
49 | before invoking the system call. | |
50 | ||
51 | Sometimes, however, the wrapper function does some extra work | |
52 | before invoking the system call. | |
53 | For example, nowadays there are (for reasons described below) two | |
54 | related system calls, | |
55 | .BR truncate (2) | |
56 | and | |
57 | .BR truncate64 (2), | |
58 | and the glibc | |
59 | .BR truncate () | |
61d7d93c MK |
60 | wrapper function checks which of those system calls |
61 | are provided by the kernel and determines which should be employed. | |
7d50a840 MK |
62 | .SS System call list |
63 | Below is a list of those system calls that are common to most platforms. | |
09de4bf1 MK |
64 | In the list, the |
65 | .I Kernel | |
66 | column indicates the kernel version | |
67 | for those system calls that were new in Linux 2.2, | |
68 | or have appeared since that kernel version. | |
69 | Note the following points: | |
70 | .IP * 3 | |
71 | Where no kernel version is indicated, | |
72 | the system call appeared in kernel 2.0 or earlier. | |
7d50a840 | 73 | .\" kernel 1.2 was started from a branch of 1.0.6 |
e0bf9127 | 74 | .\" |
d6ce4960 MK |
75 | .\" Was kernel 2.0 started from a branch of 1.2.10? |
76 | .\" At least from the timestamps of the tarballs of | |
77 | .\" of 1.2.10 and 1.3.0, that's how it looks, but in | |
e0bf9127 | 78 | .\" fact the diff doesn't seem very clear, the |
d6ce4960 MK |
79 | .\" 1.3.0 .tar.bz is much bigger (2.0 MB) than the |
80 | .\" 1.2.10 .tar.bz2 (1.8 MB), and AEB points out the | |
81 | .\" timestamps of some files in 1.3.0 seem to be older | |
82 | .\" than those in 1.2.10. All of this suggests | |
83 | .\" that there might not have been a clean branch point. | |
09de4bf1 MK |
84 | .IP * |
85 | Where a system call is marked "2.2" | |
86 | this means the system call probably appeared in a 2.1.x kernel version, | |
87 | and first appeared in a stable kernel with 2.2.0. | |
f9e4d811 MK |
88 | (Development of the 2.2 kernel was initiated from a branch of kernel |
89 | 2.0.21 via the 2.1.x unstable kernel series.) | |
09de4bf1 MK |
90 | .IP * |
91 | Where a system call is marked "2.4" | |
92 | this means the system call probably appeared in a 2.3.x kernel version, | |
93 | and first appeared in a stable kernel with 2.4.0. | |
f9e4d811 MK |
94 | (Development of the 2.4 kernel was initiated from a branch of |
95 | kernel 2.2.8 via the 2.3.x unstable kernel series.) | |
09de4bf1 MK |
96 | .IP * |
97 | Where a system call is marked "2.6" | |
98 | this means the system call probably appeared in a 2.5.x kernel version, | |
99 | and first appeared in a stable kernel with 2.6.0. | |
f9e4d811 MK |
100 | (Development of kernel 2.6 was initiated from a branch |
101 | of kernel 2.4.15 via the 2.5.x unstable kernel series.) | |
09de4bf1 MK |
102 | .IP * |
103 | Starting with kernel 2.6.0, the development model changed, | |
104 | and new system calls may appear in each 2.6.x release. | |
f9e4d811 MK |
105 | In this case, the exact version number where the system call appeared |
106 | is shown. | |
107 | .IP * | |
108 | In some cases, a system call was added to a stable kernel | |
109 | series after it branched from the previous stable kernel | |
110 | series, and then backported into the earlier stable kernel series. | |
111 | For example some system calls that appeared in 2.6.x were also backported | |
112 | into a 2.4.x release after 2.4.15. | |
113 | When this is so, the version where the system call appeared | |
09de4bf1 | 114 | in both of the major kernel series is listed. |
09de4bf1 | 115 | .PP |
4731cd2e | 116 | The list of system calls that are available as at kernel 2.6.25 |
09de4bf1 MK |
117 | (or in a few cases only on older kernels) is as follows: |
118 | .\" | |
119 | .\" Looking at scripts/checksyscalls.sh in the kernel source is | |
120 | .\" instructive about i386 specifics. | |
121 | .\" | |
122 | .TS | |
7d50a840 MK |
123 | l l l |
124 | --- | |
09de4bf1 | 125 | l l l. |
e2f9e1be | 126 | \fBSystem call\fP \fBKernel\fP \fBNotes\fP |
3fffa7b6 | 127 | |
09de4bf1 MK |
128 | \fB_llseek\fP(2) |
129 | \fB_newselect\fP(2) | |
130 | \fB_sysctl\fP(2) | |
131 | \fBaccept\fP(2) | |
132 | \fBaccess\fP(2) | |
133 | \fBacct\fP(2) | |
134 | \fBadd_key\fP(2) 2.6.11 | |
135 | \fBadjtimex\fP(2) | |
136 | \fBafs_syscall\fP(2) | |
137 | \fBalarm\fP(2) | |
f9e4d811 | 138 | \fBalloc_hugepages\fP(2) 2.5.36 Removed in 2.5.44 |
09de4bf1 MK |
139 | \fBbdflush\fP(2) |
140 | \fBbind\fP(2) | |
141 | \fBbreak\fP(2) | |
142 | \fBbrk\fP(2) | |
7d50a840 | 143 | \fBcacheflush\fP(2) Not on i386 |
09de4bf1 MK |
144 | \fBcapget\fP(2) 2.2 |
145 | \fBcapset\fP(2) 2.2 | |
146 | \fBchdir\fP(2) | |
147 | \fBchmod\fP(2) | |
148 | \fBchown\fP(2) | |
149 | \fBchown32\fP(2) 2.4 | |
150 | \fBchroot\fP(2) | |
151 | \fBclock_getres\fP(2) 2.6 | |
152 | \fBclock_gettime\fP(2) 2.6 | |
153 | \fBclock_nanosleep\fP(2) 2.6 | |
154 | \fBclock_settime\fP(2) 2.6 | |
155 | \fBclone\fP(2) | |
156 | \fBclose\fP(2) | |
157 | \fBconnect\fP(2) | |
158 | \fBcreat\fP(2) | |
159 | \fBcreate_module\fP(2) | |
160 | \fBdelete_module\fP(2) | |
161 | \fBdup\fP(2) | |
162 | \fBdup2\fP(2) | |
163 | \fBepoll_create\fP(2) 2.6 | |
164 | \fBepoll_ctl\fP(2) 2.6 | |
165 | \fBepoll_pwait\fP(2) 2.6.19 | |
166 | \fBepoll_wait\fP(2) 2.6 | |
167 | \fBeventfd\fP(2) 2.6.22 | |
168 | \fBexecve\fP(2) | |
169 | \fBexit\fP(2) | |
170 | \fBexit_group\fP(2) 2.6; 2.4.20 | |
171 | \fBfaccessat\fP(2) 2.6.16 | |
7d50a840 MK |
172 | \fBfadvise64\fP(2) 2.6 |
173 | .\" Implements \fBposix_fadvise\fP(2) | |
174 | \fBfadvise64_64\fP(2) 2.6 | |
6397da8c | 175 | \fBfallocate\fP(2) 2.6.23 |
09de4bf1 MK |
176 | \fBfchdir\fP(2) |
177 | \fBfchmod\fP(2) | |
178 | \fBfchmodat\fP(2) 2.6.16 | |
179 | \fBfchown\fP(2) | |
180 | \fBfchown32\fP(2) 2.4 | |
181 | \fBfchownat\fP(2) 2.6.16 | |
182 | \fBfcntl\fP(2) | |
183 | \fBfcntl64\fP(2) 2.4 | |
184 | \fBfdatasync\fP(2) | |
185 | \fBfgetxattr\fP(2) 2.6; 2.4.18 | |
186 | \fBflistxattr\fP(2) 2.6; 2.4.18 | |
187 | \fBflock\fP(2) | |
188 | \fBfork\fP(2) | |
f9e4d811 | 189 | \fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44 |
09de4bf1 MK |
190 | \fBfremovexattr\fP(2) 2.6; 2.4.18 |
191 | \fBfsetxattr\fP(2) 2.6; 2.4.18 | |
192 | \fBfstat\fP(2) | |
193 | \fBfstat64\fP(2) 2.4 | |
f6b8bc07 | 194 | \fBfstatat64\fP(2) 2.6.16 |
09de4bf1 MK |
195 | \fBfstatfs\fP(2) |
196 | \fBfstatfs64\fP(2) 2.6 | |
197 | \fBfsync\fP(2) | |
7d50a840 MK |
198 | \fBftime\fP(2) |
199 | .\" Implemented in glibc; see \fBftime\fP(3) | |
09de4bf1 MK |
200 | \fBftruncate\fP(2) |
201 | \fBftruncate64\fP(2) 2.4 | |
202 | \fBfutex\fP(2) 2.6; 2.4.19 | |
203 | \fBfutimesat\fP(2) 2.6.16 | |
204 | \fBget_kernel_syms\fP(2) | |
205 | \fBget_mempolicy\fP(2) 2.6.6 | |
206 | \fBget_robust_list\fP(2) 2.6.17 | |
207 | \fBget_thread_area\fP(2) 2.6; 2.4.20 | |
208 | \fBgetcpu\fP(2) 2.6.19 | |
209 | \fBgetcwd\fP(2) 2.2 | |
210 | \fBgetdents\fP(2) | |
211 | \fBgetdents64\fP(2) 2.4 | |
212 | \fBgetegid\fP(2) | |
213 | \fBgetegid32\fP(2) 2.4 | |
214 | \fBgeteuid\fP(2) | |
215 | \fBgeteuid32\fP(2) 2.4 | |
216 | \fBgetgid\fP(2) | |
217 | \fBgetgid32\fP(2) 2.4 | |
218 | \fBgetgroups\fP(2) | |
219 | \fBgetgroups32\fP(2) 2.4 | |
220 | \fBgetitimer\fP(2) | |
221 | \fBgetpeername\fP(2) | |
7d50a840 | 222 | \fBgetpagesize\fP(2) Not on i386 |
09de4bf1 MK |
223 | \fBgetpgid\fP(2) |
224 | \fBgetpgrp\fP(2) | |
225 | \fBgetpid\fP(2) | |
7d50a840 MK |
226 | \fBgetpmsg\fP(2) 2.2 |
227 | .\" Reserved for STREAMS support | |
09de4bf1 MK |
228 | \fBgetppid\fP(2) |
229 | \fBgetpriority\fP(2) | |
230 | \fBgetresgid\fP(2) 2.2 | |
231 | \fBgetresgid32\fP(2) 2.4 | |
232 | \fBgetresuid\fP(2) 2.2 | |
233 | \fBgetresuid32\fP(2) 2.4 | |
234 | \fBgetrlimit\fP(2) | |
235 | \fBgetrusage\fP(2) | |
236 | \fBgetsid\fP(2) | |
237 | \fBgetsockname\fP(2) | |
238 | \fBgetsockopt\fP(2) | |
239 | \fBgettid\fP(2) 2.4.11 | |
240 | \fBgettimeofday\fP(2) | |
241 | \fBgetuid\fP(2) | |
242 | \fBgetuid32\fP(2) 2.4 | |
243 | \fBgetxattr\fP(2) 2.6; 2.4.18 | |
f9e4d811 | 244 | .\" \fBgetunwind\fP(2) ??? ia64; DEPRECATED |
09de4bf1 MK |
245 | \fBgtty\fP(2) |
246 | \fBidle\fP(2) | |
247 | \fBinit_module\fP(2) | |
248 | \fBinotify_add_watch\fP(2) 2.6.13 | |
249 | \fBinotify_init\fP(2) 2.6.13 | |
250 | \fBinotify_rm_watch\fP(2) 2.6.13 | |
251 | \fBio_cancel\fP(2) 2.6; 2.4.20 | |
252 | \fBio_destroy\fP(2) 2.6; 2.4.20 | |
253 | \fBio_getevents\fP(2) 2.6; 2.4.20 | |
254 | \fBio_setup\fP(2) 2.6; 2.4.20 | |
255 | \fBio_submit\fP(2) 2.6; 2.4.20 | |
256 | \fBioctl\fP(2) | |
257 | \fBioperm\fP(2) | |
258 | \fBiopl\fP(2) | |
259 | \fBioprio_get\fP(2) 2.6.13 | |
260 | \fBioprio_set\fP(2) 2.6.13 | |
7d50a840 MK |
261 | \fBipc\fP(2) |
262 | .\" Implements System V IPC calls | |
263 | \fBkexec_load\fP(2) 2.6.7 | |
264 | .\" Was named sys_kexec_load() from 2.6.7 to 2.6.16 | |
09de4bf1 MK |
265 | \fBkeyctl\fP(2) 2.6.11 |
266 | \fBkill\fP(2) | |
267 | \fBlchown\fP(2) 2.2 | |
268 | \fBlchown32\fP(2) 2.4 | |
269 | \fBlgetxattr\fP(2) 2.6; 2.4.18 | |
270 | \fBlink\fP(2) | |
271 | \fBlinkat\fP(2) 2.6.16 | |
272 | \fBlisten\fP(2) | |
273 | \fBlistxattr\fP(2) 2.6; 2.4.18 | |
274 | \fBllistxattr\fP(2) 2.6; 2.4.18 | |
275 | \fBlock\fP(2) | |
276 | \fBlookup_dcookie\fP(2) 2.6 | |
277 | \fBlremovexattr\fP(2) 2.6; 2.4.18 | |
278 | \fBlseek\fP(2) | |
279 | \fBlsetxattr\fP(2) 2.6; 2.4.18 | |
280 | \fBlstat\fP(2) | |
281 | \fBlstat64\fP(2) 2.4 | |
282 | \fBmadvise\fP(2) 2.4 | |
283 | \fBmadvise1\fP(2) 2.4 | |
284 | \fBmbind\fP(2) 2.6.6 | |
285 | .\" \fBmemory_ordering\fP(2) ??? Sparc64 | |
286 | \fBmigrate_pages\fP(2) 2.6.16 | |
287 | \fBmincore\fP(2) 2.4 | |
288 | \fBmkdir\fP(2) | |
289 | \fBmkdirat\fP(2) 2.6.16 | |
290 | \fBmknod\fP(2) | |
291 | \fBmknodat\fP(2) 2.6.16 | |
292 | \fBmlock\fP(2) | |
293 | \fBmlockall\fP(2) | |
294 | \fBmmap\fP(2) | |
295 | \fBmmap2\fP(2) 2.4 | |
296 | \fBmodify_ldt\fP(2) | |
297 | \fBmount\fP(2) | |
298 | \fBmove_pages\fP(2) 2.6.18 | |
299 | \fBmprotect\fP(2) | |
300 | \fBmpx\fP(2) | |
7d50a840 MK |
301 | \fBmq_getsetattr\fP(2) 2.6.6 |
302 | .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3) | |
09de4bf1 MK |
303 | \fBmq_notify\fP(2) 2.6.6 |
304 | \fBmq_open\fP(2) 2.6.6 | |
305 | \fBmq_timedreceive\fP(2) 2.6.6 | |
306 | \fBmq_timedsend\fP(2) 2.6.6 | |
307 | \fBmq_unlink\fP(2) | |
308 | \fBmremap\fP(2) | |
309 | \fBmsgctl\fP(2) | |
310 | \fBmsgget\fP(2) | |
311 | \fBmsgrcv\fP(2) | |
312 | \fBmsgsnd\fP(2) | |
313 | \fBmsync\fP(2) | |
af4c9a82 MK |
314 | .\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on |
315 | .\" PowerPC, but unimplemented? | |
09de4bf1 MK |
316 | \fBmunlock\fP(2) |
317 | \fBmunlockall\fP(2) | |
318 | \fBmunmap\fP(2) | |
319 | \fBnanosleep\fP(2) | |
320 | \fBnfsservctl\fP(2) 2.2 | |
321 | \fBnice\fP(2) | |
322 | \fBoldfstat\fP(2) | |
323 | \fBoldlstat\fP(2) | |
324 | \fBoldolduname\fP(2) | |
325 | \fBoldstat\fP(2) | |
326 | \fBolduname\fP(2) | |
327 | \fBopen\fP(2) | |
328 | \fBopenat\fP(2) 2.6.16 | |
329 | \fBpause\fP(2) | |
7d50a840 MK |
330 | \fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on i386 |
331 | .\" Alpha, PowerPC, ARM; not i386 | |
332 | \fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on i386 | |
333 | .\" , PowerPC, ARM; not i386 | |
334 | \fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on i386 | |
8a3ed0f0 | 335 | .\" , PowerPC, ARM; not i386 |
09de4bf1 MK |
336 | \fBpersonality\fP(2) |
337 | .\" \fBperfctr\fP(2) ??? Sparc32, Sparc64 | |
22399250 | 338 | .\" \fBperfmonctl\fP(2) ??? ia64 |
7d50a840 MK |
339 | \fBphys\fP(2) |
340 | .\" Unimplemented (no slot since 2.1.116) | |
09de4bf1 MK |
341 | \fBpipe\fP(2) |
342 | \fBpivot_root\fP(2) 2.5 | |
343 | \fBpoll\fP(2) 2.2 | |
344 | \fBppoll\fP(2) 2.6.16 | |
345 | \fBprctl\fP(2) 2.2 | |
346 | \fBpread64\fP(2) Added as "pread" in 2.2; | |
347 | renamed "pread64" in 2.6 | |
348 | \fBprof\fP(2) | |
7d50a840 MK |
349 | \fBprofil\fP(2) |
350 | .\" Implemented in glibc; see \fBprofil\fP(3) | |
351 | \fBpselect6\fP(2) 2.6.16 | |
352 | .\" Implements \fBpselect\fP(2) | |
09de4bf1 | 353 | \fBptrace\fP(2) |
7d50a840 MK |
354 | \fBputpmsg\fP(2) 2.2 |
355 | .\" Reserved for STREAMS support | |
09de4bf1 MK |
356 | \fBpwrite64\fP(2) Added as "pwrite" in 2.2; |
357 | renamed "pwrite64" in 2.6 | |
358 | \fBquery_module\fP(2) 2.2 | |
359 | \fBquotactl\fP(2) | |
360 | \fBread\fP(2) | |
361 | \fBreadahead\fP(2) 2.4.13 | |
7d50a840 MK |
362 | \fBreaddir\fP(2) |
363 | .\" Supersedes \fBgetdents\fP(2) | |
09de4bf1 MK |
364 | \fBreadlink\fP(2) |
365 | \fBreadlinkat\fP(2) 2.6.16 | |
366 | \fBreadv\fP(2) | |
367 | \fBreboot\fP(2) | |
368 | \fBrecv\fP(2) | |
369 | \fBrecvfrom\fP(2) | |
370 | \fBrecvmsg\fP(2) | |
371 | \fBremap_file_pages\fP(2) 2.6 | |
372 | \fBremovexattr\fP(2) 2.6; 2.4.18 | |
373 | \fBrename\fP(2) | |
374 | \fBrenameat\fP(2) 2.6.16 | |
375 | \fBrequest_key\fP(2) 2.6.11 | |
376 | \fBrestart_syscall\fP(2) 2.6 | |
377 | \fBrmdir\fP(2) | |
378 | \fBrt_sigaction\fP(2) 2.2 | |
379 | \fBrt_sigpending\fP(2) 2.2 | |
380 | \fBrt_sigprocmask\fP(2) 2.2 | |
7d50a840 MK |
381 | \fBrt_sigqueueinfo\fP(2) 2.2 |
382 | .\" Implements \fBsigqueue\fP(2) | |
09de4bf1 MK |
383 | \fBrt_sigreturn\fP(2) 2.2 |
384 | \fBrt_sigsuspend\fP(2) 2.2 | |
385 | \fBrt_sigtimedwait\fP(2) 2.2 | |
386 | \fBsched_get_priority_max\fP(2) | |
387 | \fBsched_get_priority_min\fP(2) | |
388 | \fBsched_getaffinity\fP(2) 2.6; 2.4.19 | |
389 | \fBsched_getparam\fP(2) | |
390 | \fBsched_getscheduler\fP(2) | |
391 | \fBsched_rr_get_interval\fP(2) | |
392 | \fBsched_setaffinity\fP(2) 2.6; 2.4.19 | |
393 | \fBsched_setparam\fP(2) | |
394 | \fBsched_setscheduler\fP(2) | |
395 | \fBsched_yield\fP(2) | |
f9e4d811 | 396 | \fBsecurity\fP(2) 2.4.11 |
09de4bf1 MK |
397 | \fBselect\fP(2) |
398 | \fBsemctl\fP(2) | |
399 | \fBsemget\fP(2) | |
400 | \fBsemop\fP(2) | |
401 | \fBsemtimedop\fP(2) 2.6; 2.4.22 | |
402 | \fBsend\fP(2) | |
403 | \fBsendfile\fP(2) 2.2 | |
404 | \fBsendfile64\fP(2) 2.6; 2.4.19 | |
405 | \fBsendmsg\fP(2) | |
406 | \fBsendto\fP(2) | |
407 | \fBset_mempolicy\fP(2) 2.6.6 | |
408 | \fBset_robust_list\fP(2) 2.6.17 | |
409 | \fBset_thread_area\fP(2) 2.6; 2.4.20 | |
410 | \fBset_tid_address\fP(2) 2.6 | |
9947a8d7 MK |
411 | \fBset_zone_reclaim\fP(2) 2.6.13 Removed in 2.6.16 (was never |
412 | available to userspace) | |
413 | .\" See http://lkml.org/lkml/2005/8/1/83 | |
414 | .\" "[PATCH] remove sys_set_zone_reclaim()" | |
09de4bf1 MK |
415 | \fBsetdomainname\fP(2) |
416 | \fBsetfsgid\fP(2) | |
417 | \fBsetfsgid32\fP(2) 2.4 | |
418 | \fBsetfsuid\fP(2) | |
419 | \fBsetfsuid32\fP(2) 2.4 | |
420 | \fBsetgid\fP(2) | |
421 | \fBsetgid32\fP(2) 2.4 | |
422 | \fBsetgroups\fP(2) | |
423 | \fBsetgroups32\fP(2) 2.4 | |
424 | \fBsethostname\fP(2) | |
425 | \fBsetitimer\fP(2) | |
426 | \fBsetpgid\fP(2) | |
427 | \fBsetpriority\fP(2) | |
428 | \fBsetregid\fP(2) | |
429 | \fBsetregid32\fP(2) 2.4 | |
430 | \fBsetresgid\fP(2) 2.2 | |
431 | \fBsetresgid32\fP(2) 2.4 | |
432 | \fBsetresuid\fP(2) 2.2 | |
433 | \fBsetresuid32\fP(2) 2.4 | |
434 | \fBsetreuid\fP(2) | |
435 | \fBsetreuid32\fP(2) 2.4 | |
436 | \fBsetrlimit\fP(2) | |
437 | \fBsetsid\fP(2) | |
438 | \fBsetsockopt\fP(2) | |
439 | \fBsettimeofday\fP(2) | |
440 | \fBsetuid\fP(2) | |
441 | \fBsetuid32\fP(2) 2.4 | |
442 | \fBsetup\fP(2) Removed in 2.2 | |
443 | \fBsetxattr\fP(2) 2.6; 2.4.18 | |
444 | \fBsgetmask\fP(2) | |
445 | \fBshmat\fP(2) | |
446 | \fBshmctl\fP(2) | |
447 | \fBshmdt\fP(2) | |
448 | \fBshmget\fP(2) | |
449 | \fBshutdown\fP(2) | |
450 | \fBsigaction\fP(2) | |
451 | \fBsigaltstack\fP(2) 2.2 | |
452 | \fBsignal\fP(2) | |
453 | \fBsignalfd\fP(2) 2.6.22 | |
454 | \fBsigpending\fP(2) | |
455 | \fBsigprocmask\fP(2) | |
456 | \fBsigreturn\fP(2) | |
457 | \fBsigsuspend\fP(2) | |
458 | \fBsocket\fP(2) | |
7d50a840 MK |
459 | \fBsocketcall\fP(2) |
460 | .\" Implements BSD socket calls | |
09de4bf1 MK |
461 | \fBsocketpair\fP(2) |
462 | \fBsplice\fP(2) 2.6.17 | |
f9e4d811 MK |
463 | \fBspu_create\fP(2) 2.6.16 PowerPC only |
464 | \fBspu_run\fP(2) 2.6.16 PowerPC only | |
09de4bf1 MK |
465 | \fBssetmask\fP(2) |
466 | \fBstat\fP(2) | |
467 | \fBstat64\fP(2) 2.4 | |
468 | \fBstatfs\fP(2) | |
469 | \fBstatfs64\fP(2) 2.6 | |
470 | \fBstime\fP(2) | |
471 | \fBstty\fP(2) | |
472 | \fBswapoff\fP(2) | |
473 | \fBswapon\fP(2) | |
474 | \fBsymlink\fP(2) | |
475 | \fBsymlinkat\fP(2) 2.6.16 | |
476 | \fBsync\fP(2) | |
477 | \fBsync_file_range\fP(2) 2.6.17 | |
af4c9a82 | 478 | .\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32 |
09de4bf1 MK |
479 | \fBsysfs\fP(2) |
480 | \fBsysinfo\fP(2) | |
7d50a840 MK |
481 | \fBsyslog\fP(2) |
482 | .\" glibc interface is \fBklogctl\fP(3) | |
09de4bf1 MK |
483 | \fBtee\fP(2) 2.6.17 |
484 | \fBtgkill\fP(2) 2.6 | |
485 | \fBtime\fP(2) | |
486 | \fBtimer_create\fP(2) 2.6 | |
487 | \fBtimer_delete\fP(2) 2.6 | |
488 | \fBtimer_getoverrun\fP(2) 2.6 | |
489 | \fBtimer_gettime\fP(2) 2.6 | |
490 | \fBtimer_settime\fP(2) 2.6 | |
0df29603 MK |
491 | \fBtimerfd_create\fP(2) 2.6.25 |
492 | \fBtimerfd_gettime\fP(2) 2.6.25 | |
493 | \fBtimerfd_settime\fP(2) 2.6.25 | |
09de4bf1 MK |
494 | \fBtimes\fP(2) |
495 | \fBtkill\fP(2) 2.6; 2.4.22 | |
496 | \fBtruncate\fP(2) | |
497 | \fBtruncate64\fP(2) 2.4 | |
7d50a840 MK |
498 | \fBtuxcall\fP(2) |
499 | .\" Unimplemented; no slot on i386 | |
f9e4d811 | 500 | .\" As at 2.6.22, tuxcall has a slot on PowerPC, x86_64, and alpha |
09de4bf1 | 501 | \fBugetrlimit\fP(2) 2.4 |
7d50a840 MK |
502 | \fBulimit\fP(2) |
503 | .\" Implemented in glibc; see \fBulimit\fP(3) | |
09de4bf1 MK |
504 | \fBumask\fP(2) |
505 | \fBumount\fP(2) | |
506 | .\" sys_oldumount() -- __NR_umount | |
507 | \fBumount2\fP(2) 2.2 | |
508 | .\" sys_umount() -- __NR_umount2 | |
509 | \fBuname\fP(2) | |
510 | \fBunlink\fP(2) | |
511 | \fBunlinkat\fP(2) 2.6.16 | |
512 | \fBunshare\fP(2) 2.6.16 | |
513 | \fBuselib\fP(2) | |
514 | \fBustat\fP(2) | |
515 | \fButime\fP(2) | |
516 | \fButimensat\fP(2) 2.6.22 | |
517 | \fButimes\fP(2) 2.6 | |
518 | \fBvfork\fP(2) | |
519 | \fBvhangup\fP(2) | |
7d50a840 MK |
520 | \fBvm86old\fP(2) |
521 | .\" Superseded by \fBvm86\fP(2) | |
09de4bf1 MK |
522 | \fBvmsplice\fP(2) 2.6.17 |
523 | \fBvserver\fP(2) 2.6 | |
524 | \fBwait4\fP(2) | |
525 | \fBwaitid\fP(2) 2.6.10 | |
526 | \fBwaitpid\fP(2) | |
527 | \fBwrite\fP(2) | |
528 | \fBwritev\fP(2) | |
529 | .TE | |
530 | .PP | |
7d50a840 MK |
531 | On many platforms, including i386, socket calls are all multiplexed |
532 | (via glibc wrapper functions) through | |
533 | .BR socketcall (2) | |
534 | and similarly System V IPC calls are multiplexed through | |
535 | .BR ipc (2). | |
536 | .SH NOTES | |
09de4bf1 | 537 | Note the following points: |
09de4bf1 MK |
538 | .IP * 3 |
539 | Although slots are reserved for them in the system call table, | |
e0bf9127 | 540 | the following system calls are not implemented in the standard kernel: |
09de4bf1 MK |
541 | .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386 |
542 | .BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386 | |
543 | .BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386 | |
544 | .BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386 | |
545 | .BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386 | |
546 | .BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386 | |
547 | .BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386 | |
548 | .BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386 | |
549 | .BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386 | |
550 | .BR phys (2), \" Slot has been re-used | |
551 | .BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386 | |
552 | .BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386 | |
553 | .BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386 | |
f9e4d811 MK |
554 | .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present |
555 | .\" on a couple of 2.6 architectures | |
556 | .BR security (2), \" __NR_security is 223 on Linux 2.4/i386 | |
09de4bf1 | 557 | .BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386 |
af4c9a82 | 558 | .BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha |
09de4bf1 MK |
559 | .BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386 |
560 | and | |
561 | .BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 | |
fea681da | 562 | (see also |
fea681da MK |
563 | .BR unimplemented (2)). |
564 | However, | |
565 | .BR ftime (3), | |
566 | .BR profil (3) | |
567 | and | |
568 | .BR ulimit (3) | |
569 | exist as library routines. | |
09de4bf1 MK |
570 | The slot for |
571 | .BR phys (2) | |
572 | is in use since kernel 2.1.116 for | |
573 | .BR umount (2); | |
e0bf9127 | 574 | .BR phys (2) |
09de4bf1 MK |
575 | will never be implemented. |
576 | .IP * | |
577 | The | |
578 | .BR getpmsg (2) | |
579 | and | |
580 | .BR putpmsg (2) | |
581 | calls are for kernels patched to support STREAMS, | |
582 | and may never be in the standard kernel. | |
583 | .\" The security call is for future use. | |
584 | .PP | |
fea681da MK |
585 | Roughly speaking, the code belonging to the system call |
586 | with number __NR_xxx defined in | |
587 | .I /usr/include/asm/unistd.h | |
588 | can be found in the kernel source in the routine | |
63aa9df0 | 589 | .IR sys_xxx (). |
fea681da MK |
590 | (The dispatch table for i386 can be found in |
591 | .IR /usr/src/linux/arch/i386/kernel/entry.S .) | |
592 | There are many exceptions, however, mostly because | |
593 | older system calls were superseded by newer ones, | |
c13182ef MK |
594 | and this has been treated somewhat unsystematically. |
595 | On platforms with | |
fea681da MK |
596 | proprietary OS emulation, such as parisc, sparc, sparc64 and alpha, |
597 | there are many additional system calls; mips64 also contains a full | |
598 | set of 32-bit system calls. | |
fea681da | 599 | |
09de4bf1 MK |
600 | Over time, changes to the interfaces of some system calls have been |
601 | necessary. | |
602 | One reason for such changes was the need to increase the size of | |
603 | structures or scalar values passed to the system call. | |
7d50a840 MK |
604 | Because of these changes, there are now various groups |
605 | of related system calls | |
606 | (e.g., | |
607 | .BR truncate (2) | |
608 | and | |
e04e8187 | 609 | .BR truncate64 (2)) |
7d50a840 MK |
610 | which perform similar tasks, but which vary in |
611 | details such as the size of their arguments. | |
612 | (As noted earlier, applications are generally unaware of this: | |
613 | the glibc wrapper functions do some work to ensure that the right | |
614 | system call is invoked, and that ABI compatibility is | |
615 | preserved for old binaries.) | |
09de4bf1 MK |
616 | Examples of systems calls that exist in multiple versions are |
617 | the following: | |
618 | .IP * 3 | |
7d50a840 | 619 | By now there are three different versions of |
09de4bf1 MK |
620 | .BR stat (2): |
621 | .IR sys_stat () | |
622 | (slot | |
623 | .IR __NR_oldstat ), | |
624 | .IR sys_newstat () | |
625 | (slot | |
626 | .IR __NR_stat ), | |
fea681da | 627 | and |
92a5f983 | 628 | .IR sys_stat64 () |
09de4bf1 MK |
629 | (slot |
630 | .IR __NR_stat64 ), | |
631 | with the last being the most current. | |
f9e4d811 | 632 | .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195 |
09de4bf1 MK |
633 | .\" The stat system calls deal with three different data structures, |
634 | .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64 | |
635 | A similar story applies for | |
636 | .BR lstat (2) | |
637 | and | |
638 | .BR fstat (2). | |
639 | .IP * | |
640 | Similarly, the defines | |
641 | .IR __NR_oldolduname , | |
642 | .IR __NR_olduname , | |
643 | and | |
0daa9e92 | 644 | .I __NR_uname |
09de4bf1 MK |
645 | refer to the routines |
646 | .IR sys_olduname (), | |
647 | .IR sys_uname () | |
648 | and | |
649 | .IR sys_newuname (). | |
650 | .IP * | |
7d50a840 | 651 | In Linux 2.0, a new version of |
09de4bf1 MK |
652 | .BR vm86 (2) |
653 | appeared, with the old and the new kernel routines being named | |
654 | .IR sys_vm86old () | |
655 | and | |
656 | .IR sys_vm86 (). | |
657 | .IP * | |
7d50a840 | 658 | In Linux 2.4, a new version of |
09de4bf1 MK |
659 | .BR getrlimit (2) |
660 | appeared, with the old and the new kernel routines being named | |
661 | .IR sys_old_getrlimit () | |
662 | (slot | |
663 | .IR __NR_getrlimit ) | |
664 | and | |
665 | .IR sys_getrlimit () | |
666 | (slot | |
667 | .IR __NR_ugetrlimit ). | |
668 | .IP * | |
669 | Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. | |
670 | .\" 64 bit off_t changes: ftruncate64, *stat64, | |
671 | .\" fcntl64 (because of the flock structure), getdents64, *statfs64 | |
672 | To support this change, a range of system calls were added | |
673 | (e.g., | |
674 | .BR chown32 (2), | |
675 | .BR getuid32 (2), | |
676 | .BR getgroups32 (2), | |
677 | .BR setresuid32 (2)), | |
678 | superseding earlier calls of the same name without the | |
679 | "32" suffix. | |
680 | .IP * | |
681 | Linux 2.4 added support for applications on 32-bit architectures | |
682 | to access large files (i.e., files for which the sizes and | |
683 | file offsets can't be represented in 32 bits.) | |
684 | To support this change, replacements were required for system calls | |
685 | that deal with file offsets and sizes. | |
686 | Thus the following system calls were added: | |
687 | .BR fcntl64 (2), | |
688 | .BR ftruncate64 (2), | |
689 | .BR getdents64 (2), | |
690 | .BR stat64 (2), | |
691 | .BR statfs64 (2), | |
692 | and their analogs that work with file descriptors or | |
693 | symbolic links. | |
694 | These system calls supersede the older system calls | |
695 | which, except in the case of the "stat" calls, | |
696 | have the same name without the "64" suffix. | |
ca92ce95 | 697 | |
09de4bf1 MK |
698 | On newer platforms that only have 64-bit file access and 32-bit uids |
699 | (e.g., alpha, ia64, s390x) there are no *64 or *32 calls. | |
700 | Where the *64 and *32 calls exist, the other versions are obsolete. | |
701 | .IP * | |
702 | The | |
703 | .I rt_sig* | |
704 | calls were added in kernel 2.2 to support the addition | |
705 | of real-time signals (see | |
706 | .BR signal (7)). | |
707 | These system calls supersede the older system calls of the same | |
708 | name without the "rt_" prefix. | |
709 | .IP * | |
7d50a840 MK |
710 | The |
711 | .BR select (2) | |
fea681da | 712 | and |
7d50a840 MK |
713 | .BR mmap (2) |
714 | system calls use five or more parameters, | |
715 | which caused problems the way | |
c13182ef | 716 | parameter passing on the i386 used to be set up. |
7d50a840 | 717 | Thus, while other architectures have |
09de4bf1 MK |
718 | .IR sys_select () |
719 | and | |
720 | .IR sys_mmap () | |
721 | corresponding to | |
0daa9e92 | 722 | .I __NR_select |
09de4bf1 MK |
723 | and |
724 | .IR __NR_mmap , | |
725 | on i386 one finds | |
726 | .IR old_select () | |
727 | and | |
728 | .IR old_mmap () | |
729 | (routines that use a pointer to a | |
c13182ef MK |
730 | parameter block) instead. |
731 | These days passing five parameters | |
09de4bf1 | 732 | is not a problem any more, and there is a |
0daa9e92 | 733 | .I __NR__newselect |
7d50a840 MK |
734 | .\" (used by libc 6) |
735 | that corresponds directly to | |
09de4bf1 MK |
736 | .IR sys_select () |
737 | and similarly | |
7d50a840 MK |
738 | .IR __NR_mmap2 . |
739 | .\" .PP | |
740 | .\" Two system call numbers, | |
741 | .\" .IR __NR__llseek | |
742 | .\" and | |
743 | .\" .IR __NR__sysctl | |
744 | .\" have an additional underscore absent in | |
745 | .\" .IR sys_llseek () | |
746 | .\" and | |
747 | .\" .IR sys_sysctl (). | |
e0bf9127 | 748 | .\" |
7d50a840 MK |
749 | .\" In kernel 2.1.81, |
750 | .\" .BR lchown (2) | |
e0bf9127 | 751 | .\" and |
7d50a840 MK |
752 | .\" .BR chown (2) |
753 | .\" were swapped; that is, | |
754 | .\" .BR lchown (2) | |
755 | .\" was added with the semantics that were then current for | |
756 | .\" .BR chown (2), | |
757 | .\" and the semantics of the latter call were changed to what | |
758 | .\" they are today. | |
09de4bf1 MK |
759 | .SH SEE ALSO |
760 | .BR syscall (2), | |
761 | .BR unimplemented (2) |