]>
Commit | Line | Data |
---|---|---|
09de4bf1 MK |
1 | .\" Copyright (C) 2007 Michael Kerrisk <mtk-manpages@gmx.net> |
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 | .\" | |
61d7d93c | 29 | .TH SYSCALLS 2 2007-07-20 "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 |
d6ce4960 MK |
74 | .\" |
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 | |
78 | .\" fact the diff doesn't seem very clear, the | |
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 MK |
115 | .PP |
116 | The list of system calls that are available as at kernel 2.6.22 | |
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. |
3fffa7b6 MK |
126 | \fBSystem call Kernel Notes\fP |
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 | |
09de4bf1 MK |
175 | \fBfchdir\fP(2) |
176 | \fBfchmod\fP(2) | |
177 | \fBfchmodat\fP(2) 2.6.16 | |
178 | \fBfchown\fP(2) | |
179 | \fBfchown32\fP(2) 2.4 | |
180 | \fBfchownat\fP(2) 2.6.16 | |
181 | \fBfcntl\fP(2) | |
182 | \fBfcntl64\fP(2) 2.4 | |
183 | \fBfdatasync\fP(2) | |
184 | \fBfgetxattr\fP(2) 2.6; 2.4.18 | |
185 | \fBflistxattr\fP(2) 2.6; 2.4.18 | |
186 | \fBflock\fP(2) | |
187 | \fBfork\fP(2) | |
f9e4d811 | 188 | \fBfree_hugepages\fP(2) 2.5.36 Removed in 2.5.44 |
09de4bf1 MK |
189 | \fBfremovexattr\fP(2) 2.6; 2.4.18 |
190 | \fBfsetxattr\fP(2) 2.6; 2.4.18 | |
191 | \fBfstat\fP(2) | |
192 | \fBfstat64\fP(2) 2.4 | |
193 | \fBfstatat64\fP(2) 2.6.16? | |
194 | \fBfstatfs\fP(2) | |
195 | \fBfstatfs64\fP(2) 2.6 | |
196 | \fBfsync\fP(2) | |
7d50a840 MK |
197 | \fBftime\fP(2) |
198 | .\" Implemented in glibc; see \fBftime\fP(3) | |
09de4bf1 MK |
199 | \fBftruncate\fP(2) |
200 | \fBftruncate64\fP(2) 2.4 | |
201 | \fBfutex\fP(2) 2.6; 2.4.19 | |
202 | \fBfutimesat\fP(2) 2.6.16 | |
203 | \fBget_kernel_syms\fP(2) | |
204 | \fBget_mempolicy\fP(2) 2.6.6 | |
205 | \fBget_robust_list\fP(2) 2.6.17 | |
206 | \fBget_thread_area\fP(2) 2.6; 2.4.20 | |
207 | \fBgetcpu\fP(2) 2.6.19 | |
208 | \fBgetcwd\fP(2) 2.2 | |
209 | \fBgetdents\fP(2) | |
210 | \fBgetdents64\fP(2) 2.4 | |
211 | \fBgetegid\fP(2) | |
212 | \fBgetegid32\fP(2) 2.4 | |
213 | \fBgeteuid\fP(2) | |
214 | \fBgeteuid32\fP(2) 2.4 | |
215 | \fBgetgid\fP(2) | |
216 | \fBgetgid32\fP(2) 2.4 | |
217 | \fBgetgroups\fP(2) | |
218 | \fBgetgroups32\fP(2) 2.4 | |
219 | \fBgetitimer\fP(2) | |
220 | \fBgetpeername\fP(2) | |
7d50a840 | 221 | \fBgetpagesize\fP(2) Not on i386 |
09de4bf1 MK |
222 | \fBgetpgid\fP(2) |
223 | \fBgetpgrp\fP(2) | |
224 | \fBgetpid\fP(2) | |
7d50a840 MK |
225 | \fBgetpmsg\fP(2) 2.2 |
226 | .\" Reserved for STREAMS support | |
09de4bf1 MK |
227 | \fBgetppid\fP(2) |
228 | \fBgetpriority\fP(2) | |
229 | \fBgetresgid\fP(2) 2.2 | |
230 | \fBgetresgid32\fP(2) 2.4 | |
231 | \fBgetresuid\fP(2) 2.2 | |
232 | \fBgetresuid32\fP(2) 2.4 | |
233 | \fBgetrlimit\fP(2) | |
234 | \fBgetrusage\fP(2) | |
235 | \fBgetsid\fP(2) | |
236 | \fBgetsockname\fP(2) | |
237 | \fBgetsockopt\fP(2) | |
238 | \fBgettid\fP(2) 2.4.11 | |
239 | \fBgettimeofday\fP(2) | |
240 | \fBgetuid\fP(2) | |
241 | \fBgetuid32\fP(2) 2.4 | |
242 | \fBgetxattr\fP(2) 2.6; 2.4.18 | |
f9e4d811 | 243 | .\" \fBgetunwind\fP(2) ??? ia64; DEPRECATED |
09de4bf1 MK |
244 | \fBgtty\fP(2) |
245 | \fBidle\fP(2) | |
246 | \fBinit_module\fP(2) | |
247 | \fBinotify_add_watch\fP(2) 2.6.13 | |
248 | \fBinotify_init\fP(2) 2.6.13 | |
249 | \fBinotify_rm_watch\fP(2) 2.6.13 | |
250 | \fBio_cancel\fP(2) 2.6; 2.4.20 | |
251 | \fBio_destroy\fP(2) 2.6; 2.4.20 | |
252 | \fBio_getevents\fP(2) 2.6; 2.4.20 | |
253 | \fBio_setup\fP(2) 2.6; 2.4.20 | |
254 | \fBio_submit\fP(2) 2.6; 2.4.20 | |
255 | \fBioctl\fP(2) | |
256 | \fBioperm\fP(2) | |
257 | \fBiopl\fP(2) | |
258 | \fBioprio_get\fP(2) 2.6.13 | |
259 | \fBioprio_set\fP(2) 2.6.13 | |
7d50a840 MK |
260 | \fBipc\fP(2) |
261 | .\" Implements System V IPC calls | |
262 | \fBkexec_load\fP(2) 2.6.7 | |
263 | .\" Was named sys_kexec_load() from 2.6.7 to 2.6.16 | |
09de4bf1 MK |
264 | \fBkeyctl\fP(2) 2.6.11 |
265 | \fBkill\fP(2) | |
266 | \fBlchown\fP(2) 2.2 | |
267 | \fBlchown32\fP(2) 2.4 | |
268 | \fBlgetxattr\fP(2) 2.6; 2.4.18 | |
269 | \fBlink\fP(2) | |
270 | \fBlinkat\fP(2) 2.6.16 | |
271 | \fBlisten\fP(2) | |
272 | \fBlistxattr\fP(2) 2.6; 2.4.18 | |
273 | \fBllistxattr\fP(2) 2.6; 2.4.18 | |
274 | \fBlock\fP(2) | |
275 | \fBlookup_dcookie\fP(2) 2.6 | |
276 | \fBlremovexattr\fP(2) 2.6; 2.4.18 | |
277 | \fBlseek\fP(2) | |
278 | \fBlsetxattr\fP(2) 2.6; 2.4.18 | |
279 | \fBlstat\fP(2) | |
280 | \fBlstat64\fP(2) 2.4 | |
281 | \fBmadvise\fP(2) 2.4 | |
282 | \fBmadvise1\fP(2) 2.4 | |
283 | \fBmbind\fP(2) 2.6.6 | |
284 | .\" \fBmemory_ordering\fP(2) ??? Sparc64 | |
285 | \fBmigrate_pages\fP(2) 2.6.16 | |
286 | \fBmincore\fP(2) 2.4 | |
287 | \fBmkdir\fP(2) | |
288 | \fBmkdirat\fP(2) 2.6.16 | |
289 | \fBmknod\fP(2) | |
290 | \fBmknodat\fP(2) 2.6.16 | |
291 | \fBmlock\fP(2) | |
292 | \fBmlockall\fP(2) | |
293 | \fBmmap\fP(2) | |
294 | \fBmmap2\fP(2) 2.4 | |
295 | \fBmodify_ldt\fP(2) | |
296 | \fBmount\fP(2) | |
297 | \fBmove_pages\fP(2) 2.6.18 | |
298 | \fBmprotect\fP(2) | |
299 | \fBmpx\fP(2) | |
7d50a840 MK |
300 | \fBmq_getsetattr\fP(2) 2.6.6 |
301 | .\" Implements \fBmq_getattr\fP(3) and \fBmq_setattr\fP(3) | |
09de4bf1 MK |
302 | \fBmq_notify\fP(2) 2.6.6 |
303 | \fBmq_open\fP(2) 2.6.6 | |
304 | \fBmq_timedreceive\fP(2) 2.6.6 | |
305 | \fBmq_timedsend\fP(2) 2.6.6 | |
306 | \fBmq_unlink\fP(2) | |
307 | \fBmremap\fP(2) | |
308 | \fBmsgctl\fP(2) | |
309 | \fBmsgget\fP(2) | |
310 | \fBmsgrcv\fP(2) | |
311 | \fBmsgsnd\fP(2) | |
312 | \fBmsync\fP(2) | |
af4c9a82 MK |
313 | .\" \fBmultiplexer\fP(2) ?? __NR_multiplexer reserved on |
314 | .\" PowerPC, but unimplemented? | |
09de4bf1 MK |
315 | \fBmunlock\fP(2) |
316 | \fBmunlockall\fP(2) | |
317 | \fBmunmap\fP(2) | |
318 | \fBnanosleep\fP(2) | |
319 | \fBnfsservctl\fP(2) 2.2 | |
320 | \fBnice\fP(2) | |
321 | \fBoldfstat\fP(2) | |
322 | \fBoldlstat\fP(2) | |
323 | \fBoldolduname\fP(2) | |
324 | \fBoldstat\fP(2) | |
325 | \fBolduname\fP(2) | |
326 | \fBopen\fP(2) | |
327 | \fBopenat\fP(2) 2.6.16 | |
328 | \fBpause\fP(2) | |
7d50a840 MK |
329 | \fBpciconfig_iobase\fP(2) 2.2.15; 2.4 Not on i386 |
330 | .\" Alpha, PowerPC, ARM; not i386 | |
331 | \fBpciconfig_read\fP(2) 2.0.26; 2.2 Not on i386 | |
332 | .\" , PowerPC, ARM; not i386 | |
333 | \fBpciconfig_write\fP(2) 2.0.26; 2.2 Not on i386 | |
334 | .\" , PowerPC, ARM; not i386 | |
09de4bf1 MK |
335 | \fBpersonality\fP(2) |
336 | .\" \fBperfctr\fP(2) ??? Sparc32, Sparc64 | |
337 | .\" \fBperfmonctl\fP(2) ??? IA-64 | |
7d50a840 MK |
338 | \fBphys\fP(2) |
339 | .\" Unimplemented (no slot since 2.1.116) | |
09de4bf1 MK |
340 | \fBpipe\fP(2) |
341 | \fBpivot_root\fP(2) 2.5 | |
342 | \fBpoll\fP(2) 2.2 | |
343 | \fBppoll\fP(2) 2.6.16 | |
344 | \fBprctl\fP(2) 2.2 | |
345 | \fBpread64\fP(2) Added as "pread" in 2.2; | |
346 | renamed "pread64" in 2.6 | |
347 | \fBprof\fP(2) | |
7d50a840 MK |
348 | \fBprofil\fP(2) |
349 | .\" Implemented in glibc; see \fBprofil\fP(3) | |
350 | \fBpselect6\fP(2) 2.6.16 | |
351 | .\" Implements \fBpselect\fP(2) | |
09de4bf1 | 352 | \fBptrace\fP(2) |
7d50a840 MK |
353 | \fBputpmsg\fP(2) 2.2 |
354 | .\" Reserved for STREAMS support | |
09de4bf1 MK |
355 | \fBpwrite64\fP(2) Added as "pwrite" in 2.2; |
356 | renamed "pwrite64" in 2.6 | |
357 | \fBquery_module\fP(2) 2.2 | |
358 | \fBquotactl\fP(2) | |
359 | \fBread\fP(2) | |
360 | \fBreadahead\fP(2) 2.4.13 | |
7d50a840 MK |
361 | \fBreaddir\fP(2) |
362 | .\" Supersedes \fBgetdents\fP(2) | |
09de4bf1 MK |
363 | \fBreadlink\fP(2) |
364 | \fBreadlinkat\fP(2) 2.6.16 | |
365 | \fBreadv\fP(2) | |
366 | \fBreboot\fP(2) | |
367 | \fBrecv\fP(2) | |
368 | \fBrecvfrom\fP(2) | |
369 | \fBrecvmsg\fP(2) | |
370 | \fBremap_file_pages\fP(2) 2.6 | |
371 | \fBremovexattr\fP(2) 2.6; 2.4.18 | |
372 | \fBrename\fP(2) | |
373 | \fBrenameat\fP(2) 2.6.16 | |
374 | \fBrequest_key\fP(2) 2.6.11 | |
375 | \fBrestart_syscall\fP(2) 2.6 | |
376 | \fBrmdir\fP(2) | |
377 | \fBrt_sigaction\fP(2) 2.2 | |
378 | \fBrt_sigpending\fP(2) 2.2 | |
379 | \fBrt_sigprocmask\fP(2) 2.2 | |
7d50a840 MK |
380 | \fBrt_sigqueueinfo\fP(2) 2.2 |
381 | .\" Implements \fBsigqueue\fP(2) | |
09de4bf1 MK |
382 | \fBrt_sigreturn\fP(2) 2.2 |
383 | \fBrt_sigsuspend\fP(2) 2.2 | |
384 | \fBrt_sigtimedwait\fP(2) 2.2 | |
385 | \fBsched_get_priority_max\fP(2) | |
386 | \fBsched_get_priority_min\fP(2) | |
387 | \fBsched_getaffinity\fP(2) 2.6; 2.4.19 | |
388 | \fBsched_getparam\fP(2) | |
389 | \fBsched_getscheduler\fP(2) | |
390 | \fBsched_rr_get_interval\fP(2) | |
391 | \fBsched_setaffinity\fP(2) 2.6; 2.4.19 | |
392 | \fBsched_setparam\fP(2) | |
393 | \fBsched_setscheduler\fP(2) | |
394 | \fBsched_yield\fP(2) | |
f9e4d811 | 395 | \fBsecurity\fP(2) 2.4.11 |
09de4bf1 MK |
396 | \fBselect\fP(2) |
397 | \fBsemctl\fP(2) | |
398 | \fBsemget\fP(2) | |
399 | \fBsemop\fP(2) | |
400 | \fBsemtimedop\fP(2) 2.6; 2.4.22 | |
401 | \fBsend\fP(2) | |
402 | \fBsendfile\fP(2) 2.2 | |
403 | \fBsendfile64\fP(2) 2.6; 2.4.19 | |
404 | \fBsendmsg\fP(2) | |
405 | \fBsendto\fP(2) | |
406 | \fBset_mempolicy\fP(2) 2.6.6 | |
407 | \fBset_robust_list\fP(2) 2.6.17 | |
408 | \fBset_thread_area\fP(2) 2.6; 2.4.20 | |
409 | \fBset_tid_address\fP(2) 2.6 | |
410 | \fBset_zone_reclaim\fP(2) 2.6.13 Removed in 2.6.16 | |
f9e4d811 | 411 | .\" Yes, set_zone_reclaim(2) really was an implemented system call that |
c8760c68 | 412 | .\" went away |
09de4bf1 MK |
413 | \fBsetdomainname\fP(2) |
414 | \fBsetfsgid\fP(2) | |
415 | \fBsetfsgid32\fP(2) 2.4 | |
416 | \fBsetfsuid\fP(2) | |
417 | \fBsetfsuid32\fP(2) 2.4 | |
418 | \fBsetgid\fP(2) | |
419 | \fBsetgid32\fP(2) 2.4 | |
420 | \fBsetgroups\fP(2) | |
421 | \fBsetgroups32\fP(2) 2.4 | |
422 | \fBsethostname\fP(2) | |
423 | \fBsetitimer\fP(2) | |
424 | \fBsetpgid\fP(2) | |
425 | \fBsetpriority\fP(2) | |
426 | \fBsetregid\fP(2) | |
427 | \fBsetregid32\fP(2) 2.4 | |
428 | \fBsetresgid\fP(2) 2.2 | |
429 | \fBsetresgid32\fP(2) 2.4 | |
430 | \fBsetresuid\fP(2) 2.2 | |
431 | \fBsetresuid32\fP(2) 2.4 | |
432 | \fBsetreuid\fP(2) | |
433 | \fBsetreuid32\fP(2) 2.4 | |
434 | \fBsetrlimit\fP(2) | |
435 | \fBsetsid\fP(2) | |
436 | \fBsetsockopt\fP(2) | |
437 | \fBsettimeofday\fP(2) | |
438 | \fBsetuid\fP(2) | |
439 | \fBsetuid32\fP(2) 2.4 | |
440 | \fBsetup\fP(2) Removed in 2.2 | |
441 | \fBsetxattr\fP(2) 2.6; 2.4.18 | |
442 | \fBsgetmask\fP(2) | |
443 | \fBshmat\fP(2) | |
444 | \fBshmctl\fP(2) | |
445 | \fBshmdt\fP(2) | |
446 | \fBshmget\fP(2) | |
447 | \fBshutdown\fP(2) | |
448 | \fBsigaction\fP(2) | |
449 | \fBsigaltstack\fP(2) 2.2 | |
450 | \fBsignal\fP(2) | |
451 | \fBsignalfd\fP(2) 2.6.22 | |
452 | \fBsigpending\fP(2) | |
453 | \fBsigprocmask\fP(2) | |
454 | \fBsigreturn\fP(2) | |
455 | \fBsigsuspend\fP(2) | |
456 | \fBsocket\fP(2) | |
7d50a840 MK |
457 | \fBsocketcall\fP(2) |
458 | .\" Implements BSD socket calls | |
09de4bf1 MK |
459 | \fBsocketpair\fP(2) |
460 | \fBsplice\fP(2) 2.6.17 | |
f9e4d811 MK |
461 | \fBspu_create\fP(2) 2.6.16 PowerPC only |
462 | \fBspu_run\fP(2) 2.6.16 PowerPC only | |
09de4bf1 MK |
463 | \fBssetmask\fP(2) |
464 | \fBstat\fP(2) | |
465 | \fBstat64\fP(2) 2.4 | |
466 | \fBstatfs\fP(2) | |
467 | \fBstatfs64\fP(2) 2.6 | |
468 | \fBstime\fP(2) | |
469 | \fBstty\fP(2) | |
470 | \fBswapoff\fP(2) | |
471 | \fBswapon\fP(2) | |
472 | \fBsymlink\fP(2) | |
473 | \fBsymlinkat\fP(2) 2.6.16 | |
474 | \fBsync\fP(2) | |
475 | \fBsync_file_range\fP(2) 2.6.17 | |
af4c9a82 | 476 | .\" \fBsys_debug_setcontext\fP(2) ??? PowerPC if CONFIG_PPC32 |
09de4bf1 MK |
477 | \fBsysfs\fP(2) |
478 | \fBsysinfo\fP(2) | |
7d50a840 MK |
479 | \fBsyslog\fP(2) |
480 | .\" glibc interface is \fBklogctl\fP(3) | |
09de4bf1 MK |
481 | \fBtee\fP(2) 2.6.17 |
482 | \fBtgkill\fP(2) 2.6 | |
483 | \fBtime\fP(2) | |
484 | \fBtimer_create\fP(2) 2.6 | |
485 | \fBtimer_delete\fP(2) 2.6 | |
486 | \fBtimer_getoverrun\fP(2) 2.6 | |
487 | \fBtimer_gettime\fP(2) 2.6 | |
488 | \fBtimer_settime\fP(2) 2.6 | |
489 | \fBtimerfd\fP(2) 2.6.22 | |
490 | \fBtimes\fP(2) | |
491 | \fBtkill\fP(2) 2.6; 2.4.22 | |
492 | \fBtruncate\fP(2) | |
493 | \fBtruncate64\fP(2) 2.4 | |
7d50a840 MK |
494 | \fBtuxcall\fP(2) |
495 | .\" Unimplemented; no slot on i386 | |
f9e4d811 | 496 | .\" As at 2.6.22, tuxcall has a slot on PowerPC, x86_64, and alpha |
09de4bf1 | 497 | \fBugetrlimit\fP(2) 2.4 |
7d50a840 MK |
498 | \fBulimit\fP(2) |
499 | .\" Implemented in glibc; see \fBulimit\fP(3) | |
09de4bf1 MK |
500 | \fBumask\fP(2) |
501 | \fBumount\fP(2) | |
502 | .\" sys_oldumount() -- __NR_umount | |
503 | \fBumount2\fP(2) 2.2 | |
504 | .\" sys_umount() -- __NR_umount2 | |
505 | \fBuname\fP(2) | |
506 | \fBunlink\fP(2) | |
507 | \fBunlinkat\fP(2) 2.6.16 | |
508 | \fBunshare\fP(2) 2.6.16 | |
509 | \fBuselib\fP(2) | |
510 | \fBustat\fP(2) | |
511 | \fButime\fP(2) | |
512 | \fButimensat\fP(2) 2.6.22 | |
513 | \fButimes\fP(2) 2.6 | |
514 | \fBvfork\fP(2) | |
515 | \fBvhangup\fP(2) | |
7d50a840 MK |
516 | \fBvm86old\fP(2) |
517 | .\" Superseded by \fBvm86\fP(2) | |
09de4bf1 MK |
518 | \fBvmsplice\fP(2) 2.6.17 |
519 | \fBvserver\fP(2) 2.6 | |
520 | \fBwait4\fP(2) | |
521 | \fBwaitid\fP(2) 2.6.10 | |
522 | \fBwaitpid\fP(2) | |
523 | \fBwrite\fP(2) | |
524 | \fBwritev\fP(2) | |
525 | .TE | |
526 | .PP | |
7d50a840 MK |
527 | On many platforms, including i386, socket calls are all multiplexed |
528 | (via glibc wrapper functions) through | |
529 | .BR socketcall (2) | |
530 | and similarly System V IPC calls are multiplexed through | |
531 | .BR ipc (2). | |
532 | .SH NOTES | |
09de4bf1 | 533 | Note the following points: |
09de4bf1 MK |
534 | .IP * 3 |
535 | Although slots are reserved for them in the system call table, | |
536 | the following system calls are not implemented in the standard kernel: | |
537 | .BR afs_syscall (2), \" __NR_afs_syscall is 53 on Linux 2.6.22/i386 | |
538 | .BR break (2), \" __NR_break is 17 on Linux 2.6.22/i386 | |
539 | .BR ftime (2), \" __NR_ftime is 35 on Linux 2.6.22/i386 | |
540 | .BR getpmsg (2), \" __NR_getpmsg is 188 on Linux 2.6.22/i386 | |
541 | .BR gtty (2), \" __NR_gtty is 32 on Linux 2.6.22/i386 | |
542 | .BR idle (2), \" __NR_idle is 112 on Linux 2.6.22/i386 | |
543 | .BR lock (2), \" __NR_lock is 53 on Linux 2.6.22/i386 | |
544 | .BR madvise1 (2), \" __NR_madvise1 is 219 on Linux 2.6.22/i386 | |
545 | .BR mpx (2), \" __NR_mpx is 66 on Linux 2.6.22/i386 | |
546 | .BR phys (2), \" Slot has been re-used | |
547 | .BR prof (2), \" __NR_prof is 44 on Linux 2.6.22/i386 | |
548 | .BR profil (2), \" __NR_profil is 98 on Linux 2.6.22/i386 | |
549 | .BR putpmsg (2), \" __NR_putpmsg is 189 on Linux 2.6.22/i386 | |
f9e4d811 MK |
550 | .\" __NR_security is 223 on Linux 2.4/i386; absent on 2.6/i386, present |
551 | .\" on a couple of 2.6 architectures | |
552 | .BR security (2), \" __NR_security is 223 on Linux 2.4/i386 | |
09de4bf1 | 553 | .BR stty (2), \" __NR_stty is 31 on Linux 2.6.22/i386 |
af4c9a82 | 554 | .BR tuxcall (2), \" __NR_tuxcall is 184 on x86_64, also on PPC and alpha |
09de4bf1 MK |
555 | .BR ulimit (2), \" __NR_ulimit is 58 on Linux 2.6.22/i386 |
556 | and | |
557 | .BR vserver (2) \" __NR_vserver is 273 on Linux 2.6.22/i386 | |
fea681da | 558 | (see also |
fea681da MK |
559 | .BR unimplemented (2)). |
560 | However, | |
561 | .BR ftime (3), | |
562 | .BR profil (3) | |
563 | and | |
564 | .BR ulimit (3) | |
565 | exist as library routines. | |
09de4bf1 MK |
566 | The slot for |
567 | .BR phys (2) | |
568 | is in use since kernel 2.1.116 for | |
569 | .BR umount (2); | |
570 | .BR phys (2) | |
571 | will never be implemented. | |
572 | .IP * | |
573 | The | |
574 | .BR getpmsg (2) | |
575 | and | |
576 | .BR putpmsg (2) | |
577 | calls are for kernels patched to support STREAMS, | |
578 | and may never be in the standard kernel. | |
579 | .\" The security call is for future use. | |
580 | .PP | |
fea681da MK |
581 | Roughly speaking, the code belonging to the system call |
582 | with number __NR_xxx defined in | |
583 | .I /usr/include/asm/unistd.h | |
584 | can be found in the kernel source in the routine | |
63aa9df0 | 585 | .IR sys_xxx (). |
fea681da MK |
586 | (The dispatch table for i386 can be found in |
587 | .IR /usr/src/linux/arch/i386/kernel/entry.S .) | |
588 | There are many exceptions, however, mostly because | |
589 | older system calls were superseded by newer ones, | |
c13182ef MK |
590 | and this has been treated somewhat unsystematically. |
591 | On platforms with | |
fea681da MK |
592 | proprietary OS emulation, such as parisc, sparc, sparc64 and alpha, |
593 | there are many additional system calls; mips64 also contains a full | |
594 | set of 32-bit system calls. | |
fea681da | 595 | |
09de4bf1 MK |
596 | Over time, changes to the interfaces of some system calls have been |
597 | necessary. | |
598 | One reason for such changes was the need to increase the size of | |
599 | structures or scalar values passed to the system call. | |
7d50a840 MK |
600 | Because of these changes, there are now various groups |
601 | of related system calls | |
602 | (e.g., | |
603 | .BR truncate (2) | |
604 | and | |
605 | .BR ftruncate64 (2)) | |
606 | which perform similar tasks, but which vary in | |
607 | details such as the size of their arguments. | |
608 | (As noted earlier, applications are generally unaware of this: | |
609 | the glibc wrapper functions do some work to ensure that the right | |
610 | system call is invoked, and that ABI compatibility is | |
611 | preserved for old binaries.) | |
09de4bf1 MK |
612 | Examples of systems calls that exist in multiple versions are |
613 | the following: | |
614 | .IP * 3 | |
7d50a840 | 615 | By now there are three different versions of |
09de4bf1 MK |
616 | .BR stat (2): |
617 | .IR sys_stat () | |
618 | (slot | |
619 | .IR __NR_oldstat ), | |
620 | .IR sys_newstat () | |
621 | (slot | |
622 | .IR __NR_stat ), | |
fea681da | 623 | and |
09de4bf1 MK |
624 | .IR sys_stat64() |
625 | (slot | |
626 | .IR __NR_stat64 ), | |
627 | with the last being the most current. | |
f9e4d811 | 628 | .\" e.g., on 2.6.22/i386: __NR_oldstat 18, __NR_stat 106, __NR_stat64 195 |
09de4bf1 MK |
629 | .\" The stat system calls deal with three different data structures, |
630 | .\" defined in include/asm-i386/stat.h: __old_kernel_stat, stat, stat64 | |
631 | A similar story applies for | |
632 | .BR lstat (2) | |
633 | and | |
634 | .BR fstat (2). | |
635 | .IP * | |
636 | Similarly, the defines | |
637 | .IR __NR_oldolduname , | |
638 | .IR __NR_olduname , | |
639 | and | |
640 | .IR __NR_uname | |
641 | refer to the routines | |
642 | .IR sys_olduname (), | |
643 | .IR sys_uname () | |
644 | and | |
645 | .IR sys_newuname (). | |
646 | .IP * | |
7d50a840 | 647 | In Linux 2.0, a new version of |
09de4bf1 MK |
648 | .BR vm86 (2) |
649 | appeared, with the old and the new kernel routines being named | |
650 | .IR sys_vm86old () | |
651 | and | |
652 | .IR sys_vm86 (). | |
653 | .IP * | |
7d50a840 | 654 | In Linux 2.4, a new version of |
09de4bf1 MK |
655 | .BR getrlimit (2) |
656 | appeared, with the old and the new kernel routines being named | |
657 | .IR sys_old_getrlimit () | |
658 | (slot | |
659 | .IR __NR_getrlimit ) | |
660 | and | |
661 | .IR sys_getrlimit () | |
662 | (slot | |
663 | .IR __NR_ugetrlimit ). | |
664 | .IP * | |
665 | Linux 2.4 increased the size of user and group IDs from 16 to 32 bits. | |
666 | .\" 64 bit off_t changes: ftruncate64, *stat64, | |
667 | .\" fcntl64 (because of the flock structure), getdents64, *statfs64 | |
668 | To support this change, a range of system calls were added | |
669 | (e.g., | |
670 | .BR chown32 (2), | |
671 | .BR getuid32 (2), | |
672 | .BR getgroups32 (2), | |
673 | .BR setresuid32 (2)), | |
674 | superseding earlier calls of the same name without the | |
675 | "32" suffix. | |
676 | .IP * | |
677 | Linux 2.4 added support for applications on 32-bit architectures | |
678 | to access large files (i.e., files for which the sizes and | |
679 | file offsets can't be represented in 32 bits.) | |
680 | To support this change, replacements were required for system calls | |
681 | that deal with file offsets and sizes. | |
682 | Thus the following system calls were added: | |
683 | .BR fcntl64 (2), | |
684 | .BR ftruncate64 (2), | |
685 | .BR getdents64 (2), | |
686 | .BR stat64 (2), | |
687 | .BR statfs64 (2), | |
688 | and their analogs that work with file descriptors or | |
689 | symbolic links. | |
690 | These system calls supersede the older system calls | |
691 | which, except in the case of the "stat" calls, | |
692 | have the same name without the "64" suffix. | |
693 | .sp | |
694 | On newer platforms that only have 64-bit file access and 32-bit uids | |
695 | (e.g., alpha, ia64, s390x) there are no *64 or *32 calls. | |
696 | Where the *64 and *32 calls exist, the other versions are obsolete. | |
697 | .IP * | |
698 | The | |
699 | .I rt_sig* | |
700 | calls were added in kernel 2.2 to support the addition | |
701 | of real-time signals (see | |
702 | .BR signal (7)). | |
703 | These system calls supersede the older system calls of the same | |
704 | name without the "rt_" prefix. | |
705 | .IP * | |
7d50a840 MK |
706 | The |
707 | .BR select (2) | |
fea681da | 708 | and |
7d50a840 MK |
709 | .BR mmap (2) |
710 | system calls use five or more parameters, | |
711 | which caused problems the way | |
c13182ef | 712 | parameter passing on the i386 used to be set up. |
7d50a840 | 713 | Thus, while other architectures have |
09de4bf1 MK |
714 | .IR sys_select () |
715 | and | |
716 | .IR sys_mmap () | |
717 | corresponding to | |
718 | .IR __NR_select | |
719 | and | |
720 | .IR __NR_mmap , | |
721 | on i386 one finds | |
722 | .IR old_select () | |
723 | and | |
724 | .IR old_mmap () | |
725 | (routines that use a pointer to a | |
c13182ef MK |
726 | parameter block) instead. |
727 | These days passing five parameters | |
09de4bf1 MK |
728 | is not a problem any more, and there is a |
729 | .IR __NR__newselect | |
7d50a840 MK |
730 | .\" (used by libc 6) |
731 | that corresponds directly to | |
09de4bf1 MK |
732 | .IR sys_select () |
733 | and similarly | |
7d50a840 MK |
734 | .IR __NR_mmap2 . |
735 | .\" .PP | |
736 | .\" Two system call numbers, | |
737 | .\" .IR __NR__llseek | |
738 | .\" and | |
739 | .\" .IR __NR__sysctl | |
740 | .\" have an additional underscore absent in | |
741 | .\" .IR sys_llseek () | |
742 | .\" and | |
743 | .\" .IR sys_sysctl (). | |
744 | .\" | |
745 | .\" In kernel 2.1.81, | |
746 | .\" .BR lchown (2) | |
747 | .\" and | |
748 | .\" .BR chown (2) | |
749 | .\" were swapped; that is, | |
750 | .\" .BR lchown (2) | |
751 | .\" was added with the semantics that were then current for | |
752 | .\" .BR chown (2), | |
753 | .\" and the semantics of the latter call were changed to what | |
754 | .\" they are today. | |
09de4bf1 MK |
755 | .SH SEE ALSO |
756 | .BR syscall (2), | |
757 | .BR unimplemented (2) |