]> git.saurik.com Git - apple/xnu.git/blob - bsd/kern/syscalls.c
xnu-201.19.tar.gz
[apple/xnu.git] / bsd / kern / syscalls.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /* Copyright (c) 1992,1995-1999 Apple Computer, Inc. All rights resereved. */
23 /*
24 * HISTORY
25 *
26 * 02-10-99 Clark Warner (warner_c) ta Apple
27 * Chaned call 227 to copyfile
28 * 07-14-99 Earsh Nandkeshwar (earsh) at Apple
29 * Renamed getdirentryattr to getdirentriesattr
30 * 01-22-98 Clark Warner (warner_c) at Apple
31 * Created new HFS style Systemcalls
32 * 25-May-95 Mac Gillon (mgillon) at NeXT
33 * Created from NS 3.3 and 4.4BSD
34 *
35 */
36
37 char *syscallnames[] = {
38 "syscall", /* 0 = syscall */
39 "exit", /* 1 = exit */
40 "fork", /* 2 = fork */
41 "read", /* 3 = read */
42 "write", /* 4 = write */
43 "open", /* 5 = open */
44 "close", /* 6 = close */
45 "wait4", /* 7 = wait4 */
46 "old_creat", /* 8 = old creat */
47 "link", /* 9 = link */
48 "unlink", /* 10 = unlink */
49 "obs_execv", /* 11 = obsolete execv */
50 "chdir", /* 12 = chdir */
51 "fchdir", /* 13 = fchdir */
52 "mknod", /* 14 = mknod */
53 "chmod", /* 15 = chmod */
54 "chown", /* 16 = chown */
55 "sbreak", /* 17 = obsolete sbreak */
56 "obs_stat", /* 18 = obsolete stat */
57 "old_lseek", /* 19 = old lseek */
58 "getpid", /* 20 = getpid */
59 "obs_mount", /* 21 = obsolete mount */
60 "obs_unmount", /* 22 = obsolete unmount */
61 "setuid", /* 23 = setuid */
62 "getuid", /* 24 = getuid */
63 "geteuid", /* 25 = geteuid */
64 "ptrace", /* 26 = ptrace */
65 "recvmsg", /* 27 = recvmsg */
66 "sendmsg", /* 28 = sendmsg */
67 "recvfrom", /* 29 = recvfrom */
68 "accept", /* 30 = accept */
69 "getpeername", /* 31 = getpeername */
70 "getsockname", /* 32 = getsockname */
71 "access", /* 33 = access */
72 "chflags", /* 34 = chflags */
73 "fchflags", /* 35 = fchflags */
74 "sync", /* 36 = sync */
75 "kill", /* 37 = kill */
76 "old_stat", /* 38 = old stat */
77 "getppid", /* 39 = getppid */
78 "old_lstat", /* 40 = old lstat */
79 "dup", /* 41 = dup */
80 "pipe", /* 42 = pipe */
81 "getegid", /* 43 = getegid */
82 "profil", /* 44 = profil */
83 "ktrace", /* 45 = ktrace */
84 "sigaction", /* 46 = sigaction */
85 "getgid", /* 47 = getgid */
86 "sigprocmask", /* 48 = sigprocmask */
87 "getlogin", /* 49 = getlogin */
88 "setlogin", /* 50 = setlogin */
89 "acct", /* 51 = acct */
90 "sigpending", /* 52 = sigpending */
91 "sigaltstack", /* 53 = sigaltstack */
92 "ioctl", /* 54 = ioctl */
93 "reboot", /* 55 = reboot */
94 "revoke", /* 56 = revoke */
95 "symlink", /* 57 = symlink */
96 "readlink", /* 58 = readlink */
97 "execve", /* 59 = execve */
98 "umask", /* 60 = umask */
99 "chroot", /* 61 = chroot */
100 "old_fstat", /* 62 = old fstat */
101 "old_getkerninfo", /* 63 = old getkerninfo */
102 "old_getpagesize", /* 64 = old getpagesize */
103 "msync", /* 65 = msync */
104 "vfork", /* 66 = vfork */
105 "obs_vread", /* 67 = obsolete vread */
106 "obs_vwrite", /* 68 = obsolete vwrite */
107 "sbrk", /* 69 = sbrk */
108 "sstk", /* 70 = sstk */
109 "old_mmap", /* 71 = old mmap */
110 "obs_vadvise", /* 72 = obsolete vadvise */
111 "munmap", /* 73 = munmap */
112 "mprotect", /* 74 = mprotect */
113 "madvise", /* 75 = madvise */
114 "obs_vhangup", /* 76 = obsolete vhangup */
115 "obs_vlimit", /* 77 = obsolete vlimit */
116 "mincore", /* 78 = mincore */
117 "getgroups", /* 79 = getgroups */
118 "setgroups", /* 80 = setgroups */
119 "getpgrp", /* 81 = getpgrp */
120 "setpgid", /* 82 = setpgid */
121 "setitimer", /* 83 = setitimer */
122 "old_wait", /* 84 = old wait */
123 "swapon", /* 85 = swapon */
124 "getitimer", /* 86 = getitimer */
125 "old_gethostname", /* 87 = old gethostname */
126 "old_sethostname", /* 88 = old sethostname */
127 "getdtablesize", /* 89 = getdtablesize */
128 "dup2", /* 90 = dup2 */
129 "#91", /* 91 = getdopt */
130 "fcntl", /* 92 = fcntl */
131 "select", /* 93 = select */
132 "#94", /* 94 = setdopt */
133 "fsync", /* 95 = fsync */
134 "setpriority", /* 96 = setpriority */
135 "socket", /* 97 = socket */
136 "connect", /* 98 = connect */
137 "old_accept", /* 99 = old accept */
138 "getpriority", /* 100 = getpriority */
139 "old_send", /* 101 = old send */
140 "old_recv", /* 102 = old recv */
141 "sigreturn", /* 103 = sigreturn */
142 "bind", /* 104 = bind */
143 "setsockopt", /* 105 = setsockopt */
144 "listen", /* 106 = listen */
145 "obs_vtimes", /* 107 = obsolete vtimes */
146 "old_sigvec", /* 108 = old sigvec */
147 "old_sigblock", /* 109 = old sigblock */
148 "old_sigsetmask", /* 110 = old sigsetmask */
149 "sigsuspend", /* 111 = sigsuspend */
150 "old_sigstack", /* 112 = old sigstack */
151 "old_recvmsg", /* 113 = old recvmsg */
152 "old_sendmsg", /* 114 = old sendmsg */
153 "obs_vtrace", /* 115 = obsolete vtrace */
154 "gettimeofday", /* 116 = gettimeofday */
155 "getrusage", /* 117 = getrusage */
156 "getsockopt", /* 118 = getsockopt */
157 "#119", /* 119 = nosys */
158 "readv", /* 120 = readv */
159 "writev", /* 121 = writev */
160 "settimeofday", /* 122 = settimeofday */
161 "fchown", /* 123 = fchown */
162 "fchmod", /* 124 = fchmod */
163 "old_recvfrom", /* 125 = old recvfrom */
164 "old_setreuid", /* 126 = old setreuid */
165 "old_setregid", /* 127 = old setregid */
166 "rename", /* 128 = rename */
167 "old_truncate", /* 129 = old truncate */
168 "old_ftruncate", /* 130 = old ftruncate */
169 "flock", /* 131 = flock */
170 "mkfifo", /* 132 = mkfifo */
171 "sendto", /* 133 = sendto */
172 "shutdown", /* 134 = shutdown */
173 "socketpair", /* 135 = socketpair */
174 "mkdir", /* 136 = mkdir */
175 "rmdir", /* 137 = rmdir */
176 "utimes", /* 138 = utimes */
177 "#139", /* 139 = nosys */
178 "adjtime", /* 140 = adjtime */
179 "old_getpeername", /* 141 = old getpeername */
180 "old_gethostid", /* 142 = old gethostid */
181 "old_sethostid", /* 143 = old sethostid */
182 "old_getrlimit", /* 144 = old getrlimit */
183 "old_setrlimit", /* 145 = old setrlimit */
184 "old_killpg", /* 146 = old killpg */
185 "setsid", /* 147 = setsid */
186 "obs_setquota", /* 148 = obsolete setquota */
187 "obs_quota", /* 149 = obsolete quota */
188 "old_getsockname", /* 150 = old getsockname */
189 "#151", /* 151 = nosys */
190 "setprivexec", /* 152 = setprivexec */
191 "#153", /* 153 = nosys */
192 "#154", /* 154 = nosys */
193 "nfssvc", /* 155 = nfssvc */
194 "getdirentries", /* 156 =getdirentries */
195 "statfs", /* 157 = statfs */
196 "fstatfs", /* 158 = fstatfs */
197 "unmount", /* 159 = unmount */
198 "obs_async_daemon", /* 160 = obsolete async_daemon */
199 "getfh", /* 161 = getfh */
200 "old_getdomainname",/* 162 = old getdomainname */
201 "old_setdomainname",/* 163 = old setdomainname */
202 "obs_pcfs_mount", /* 164 = obsolete pcfs_mount */
203 "quotactl", /* 165 = quotactl */
204 "obs_exportfs", /* 166 = obsolete exportfs */
205 "mount", /* 167 = mount */
206 "obs_ustat", /* 168 = obsolete ustat */
207 "#169", /* 169 = nosys */
208 "obs_table", /* 170 = obsolete table */
209 "old_wait_3", /* 171 = old wait_3 */
210 "obs_rpause", /* 172 = obsolete rpause */
211 "#173", /* 173 = nosys */
212 "obs_getdents", /* 174 = obsolete getdents */
213 "#175", /* 175 = nosys */
214 "add_profil", /* 176 = add_profil */ /* NeXT */
215 "#177", /* 177 = nosys */
216 "#178", /* 178 = nosys */
217 "#179", /* 179 = nosys */
218 "kdebug_trace", /* 180 = kdebug_trace */
219 "setgid", /* 181 = setgid */
220 "setegid", /* 182 = setegid */
221 "seteuid", /* 183 = seteuid */
222 #ifdef LFS
223 "lfs_bmapv", /* 184 = lfs_bmapv */
224 "lfs_markv", /* 185 = lfs_markv */
225 "lfs_segclean", /* 186 = lfs_segclean */
226 "lfs_segwait", /* 187 = lfs_segwait */
227 #else
228 "#184", /* 184 = nosys */
229 "#185", /* 185 = nosys */
230 "#186", /* 186 = nosys */
231 "#187", /* 187 = nosys */
232 #endif
233 "stat", /* 188 = stat */
234 "fstat", /* 189 = fstat */
235 "lstat", /* 190 = lstat */
236 "pathconf", /* 191 = pathconf */
237 "fpathconf", /* 192 = fpathconf */
238 "#193", /* 193 = nosys */
239 "getrlimit", /* 194 = getrlimit */
240 "setrlimit", /* 195 = setrlimit */
241 "#196", /* 196 = unused */
242 "mmap", /* 197 = mmap */
243 "__syscall", /* 198 = __syscall */
244 "lseek", /* 199 = lseek */
245 "truncate", /* 200 = truncate */
246 "ftruncate", /* 201 = ftruncate */
247 "__sysctl", /* 202 = __sysctl */
248 "mlock", /* 203 = mlock */
249 "munlock", /* 204 = munlock */
250 "#205", /* 205 = nosys */
251
252 /*
253 * 206 - 215 are all reserved for AppleTalk.
254 * When AppleTalk is defined some of them are in use
255 */
256
257 "#206", /* 206 = nosys */
258 "#207", /* 207 = nosys */
259 "#208", /* 208 = nosys */
260 "#209", /* 209 = nosys */
261 "#210", /* 210 = nosys */
262 "#211", /* 205 = nosys */
263 "#212", /* 206 = nosys */
264 "#213", /* 207 = nosys */
265 "#214", /* 208 = nosys */
266 "#215", /* 209 = nosys */
267 "mkcomplex", /* 216 = mkcomplex */
268 "statv", /* 217 = stav */
269 "lstatv", /* 218 = lstav */
270 "fstatv", /* 219 = fstav */
271 "getattrlist", /* 220 = getattrlist */
272 "setattrlist", /* 221 = setattrlist */
273 "getdirentriesattr", /* 222 = getdirentriesattr*/
274 "exchangedata", /* 223 = exchangedata */
275 "checkuseraccess", /* 224 - checkuseraccess*/
276 "searchfs", /* 225 = searchfs */
277 "#226", /* 226 = private delete call */
278 "#227", /* 227 = copyfile */
279 "#228", /* 228 = nosys */
280 "#229", /* 229 = nosys */
281 "#230", /* 230 = reserved for AFS */
282
283 /*
284 * 216 - 230 are all reserved for suppoorting HFS/AFP File System
285 * Semantics. 225-230 are reserved for future use.
286 */
287 "watchevent", /* 231 = watchevent */
288 "waitevent", /* 232 = waitevent */
289 "modwatch", /* 233 = modwatch */
290 "#234", /* 234 = nosys */
291 "#235", /* 235 = nosys */
292 "#236", /* 236 = nosys */
293 "#237", /* 237 = nosys */
294 "#238", /* 238 = nosys */
295 "#239", /* 239 = nosys */
296 "#240", /* 240 = nosys */
297 "#241", /* 241 = nosys */
298 "#242", /* 242 = nosys */
299 "#243", /* 243 = nosys */
300 "#244", /* 244 = nosys */
301 "#245", /* 245 = nosys */
302 "#246", /* 246 = nosys */
303 "#247", /* 247 = nosys */
304 "#248", /* 248 = nosys */
305 "#249", /* 249 = nosys */
306 "minherit", /* 250 = minherit */
307 "semsys", /* 251 = semsys */
308 "msgsys", /* 252 = msgsys */
309 "shmsys", /* 253 = shmsys */
310 "semctl", /* 254 = semctl */
311 "semget", /* 255 = semget */
312 "semop", /* 256 = semop */
313 "semconfig", /* 257 = semconfig */
314 "msgctl", /* 258 = msgctl */
315 "msgget", /* 259 = msgget */
316 "msgsnd", /* 260 = msgsnd */
317 "msgrcv", /* 261 = msgrcv */
318 "shmat", /* 262 = shmat */
319 "shmctl", /* 263 = shmctl */
320 "shmdt", /* 264 = shmdt */
321 "shmget", /* 265 = shmget */
322 "shm_open", /* 266 = shm_open */
323 "shm_unlink", /* 267 = shm_unlink */
324 "sem_open", /* 268 = sem_open */
325 "sem_close", /* 269 = sem_close */
326 "sem_unlink", /* 270 = sem_unlink */
327 "sem_wait", /* 271 = sem_wait */
328 "sem_trywait", /* 272 = sem_trywait */
329 "sem_post", /* 273 = sem_post */
330 "sem_getvalue", /* 274 = sem_getvalue */
331 "sem_init", /* 275 = sem_init */
332 "sem_destroy", /* 276 = sem_destroy */
333 "#277", /* 277 = nosys */
334 "#278", /* 278 = nosys */
335 "#279", /* 279 = nosys */
336 "#280", /* 280 = nosys */
337 "#281", /* 281 = nosys */
338 "#282", /* 282 = nosys */
339 "#283", /* 283 = nosys */
340 "#284", /* 284 = nosys */
341 "#285", /* 285 = nosys */
342 "#286", /* 286 = nosys */
343 "#287", /* 287 = nosys */
344 "#288", /* 288 = nosys */
345 "#289", /* 289 = nosys */
346 "#290", /* 290 = nosys */
347 "#291", /* 291 = nosys */
348 "#292", /* 292 = nosys */
349 "#293", /* 293 = nosys */
350 "#294", /* 294 = nosys */
351 "#295", /* 295 = nosys */
352 "load_shared_file", /* 296 = load_shared_file */
353 "reset_shared_file", /* 297 = reset_shared_file */
354 "#298", /* 298 = nosys */
355 "#299", /* 299 = nosys */
356 "#300", /* 300 = modnext */
357 "#301", /* 301 = modstat */
358 "#302", /* 302 = modfnext */
359 "#303", /* 303 = modfind */
360 "#304", /* 304 = kldload */
361 "#305", /* 305 = kldunload */
362 "#306", /* 306 = kldfind */
363 "#307", /* 307 = kldnext */
364 "#308", /* 308 = kldstat */
365 "#309", /* 309 = kldfirstmod */
366 "#310", /* 310 = getsid */
367 "#311", /* 311 = setresuid */
368 "#312", /* 312 = setresgid */
369 "#313", /* 313 = obsolete signanosleep */
370 "#314", /* 314 = aio_return */
371 "#315", /* 315 = aio_suspend */
372 "#316", /* 316 = aio_cancel */
373 "#317", /* 317 = aio_error */
374 "#318", /* 318 = aio_read */
375 "#319", /* 319 = aio_write */
376 "#320", /* 320 = lio_listio */
377 "#321", /* 321 = yield */
378 "#322", /* 322 = thr_sleep */
379 "#323", /* 323 = thr_wakeup */
380 "mlockall", /* 324 = mlockall */
381 "munlockall", /* 325 = munlockall */
382 "#326", /* 326 */
383 "issetugid" /* 327 = issetugid */
384 };