1 $NetBSD: syscalls.master,v 1.37 2009/01/11 02:45:47 christos Exp $
3 ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
5 ; NetBSD system call name/number "master" file.
6 ; (See syscalls.conf to see what it is processed into.)
8 ; Fields: number type [type-dependent ...]
9 ; number system call number, must be in order
10 ; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
11 ; the compatibility options defined in syscalls.conf.
15 ; OBSOL obsolete, not included in system
16 ; UNIMPL unimplemented, not included in system
17 ; NODEF included, but don't define the syscall number
18 ; NOARGS included, but don't define the syscall args structure
20 ; The compat options are defined in the syscalls.conf file, and the
21 ; compat option name is prefixed to the syscall name. Other than
22 ; that, they're like NODEF (for 'compat' options), or STD (for
23 ; 'libcompat' options).
25 ; The type-dependent arguments are as follows:
26 ; For STD, NODEF, NOARGS, and compat syscalls:
27 ; { pseudo-proto } [alias]
31 ; #ifdef's, etc. may be included, and are copied to the output files.
32 ; #include's are copied to the syscall names and switch definition files only.
34 ; NB: A lot of system calls are used from FreeBSD emulation, because theses
35 ; system calls are just native NetBSD plus a check in /emul/<e_name>.
37 #include "opt_ktrace.h"
38 #include "opt_nfsserver.h"
40 #include "opt_compat_netbsd.h"
42 #include "opt_compat_43.h"
47 #include <sys/param.h>
48 #include <sys/systm.h>
49 #include <sys/signal.h>
50 #include <sys/mount.h>
51 #include <sys/syscallargs.h>
53 #include <compat/sys/signal.h>
54 #include <compat/sys/time.h>
56 #include <compat/mach/mach_types.h>
57 #include <compat/mach/mach_vm.h>
59 #include <compat/darwin/darwin_types.h>
60 #include <compat/darwin/darwin_signal.h>
61 #include <compat/darwin/darwin_audit.h>
62 #include <compat/darwin/darwin_syscallargs.h>
66 0 NOARGS INDIR { int|sys||syscall(int code, \
67 ... register_t args[DARWIN_SYS_MAXSYSARGS]); }
68 1 NOARGS { void|sys||exit(int rval); }
69 2 STD { int|darwin_sys||fork(void); }
70 3 NOARGS { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }
71 4 NOARGS { ssize_t|sys||write(int fd, const void *buf, \
73 5 NOARGS { int|sys||open(const char *path, \
74 int flags, ... mode_t mode); }
75 6 NOARGS { int|sys||close(int fd); }
76 7 NOARGS { int|compat_50_sys||wait4(int pid, int *status, \
77 int options, struct rusage50 *rusage); }
78 8 NOARGS { int|compat_43_sys||creat(const char *path, \
79 mode_t mode); } ocreat
80 9 NOARGS { int|sys||link(const char *path, \
82 10 NOARGS { int|sys||unlink(const char *path); }
84 12 NOARGS { int|sys||chdir(const char *path); }
85 13 NOARGS { int|sys||fchdir(int fd); }
86 14 STD { int|darwin_sys||mknod(const char *path, \
87 mode_t mode, darwin_dev_t dev); }
88 15 NOARGS { int|sys||chmod(const char *path, mode_t mode); }
89 16 NOARGS { int|sys||chown(const char *path, uid_t uid, \
91 17 NOARGS { int|sys||obreak(char *nsize); } break
92 18 STD { int|darwin_sys||getfsstat(struct darwin_statfs *buf, \
93 long bufsize, int flags); }
94 19 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \
96 20 STD { pid_t|darwin_sys||getpid(void); }
97 21 NOARGS { int|compat_40_sys||mount(const char *type, \
98 const char *path, int flags, void *data); }
99 22 NOARGS { int|sys||unmount(const char *path, int flags); }
100 23 NOARGS { int|sys||setuid(uid_t uid); }
102 24 NOARGS { uid_t|sys||getuid_with_euid(void); } getuid
104 24 NOARGS { uid_t|sys||getuid(void); }
106 25 NOARGS { uid_t|sys||geteuid(void); }
107 26 STD { int|darwin_sys||ptrace(int req, pid_t pid, \
108 void *addr, int data); }
109 27 NOARGS { ssize_t|sys||recvmsg(int s, struct msghdr *msg, \
111 28 NOARGS { ssize_t|sys||sendmsg(int s, \
112 const struct msghdr *msg, int flags); }
113 29 STD { ssize_t|darwin_sys||recvfrom(int s, void *buf, \
114 size_t len, int flags, struct sockaddr *from, \
115 unsigned int *fromlenaddr); }
116 30 STD { int|darwin_sys||accept(int s, struct sockaddr *name, \
117 unsigned int *anamelen); }
118 31 STD { int|darwin_sys||getpeername(int fdes, \
119 struct sockaddr *asa, unsigned int *alen); }
120 32 STD { int|darwin_sys||getsockname(int fdes, \
121 struct sockaddr *asa, unsigned int *alen); }
122 33 NOARGS { int|sys||access(const char *path, \
124 34 NOARGS { int|sys||chflags(const char *path, \
126 35 NOARGS { int|sys||fchflags(int fd, u_long flags); }
127 36 NOARGS { void|sys||sync(void); }
128 37 NOARGS { int|sys||kill(int pid, int signum); }
129 38 NOARGS { int|compat_43_sys||stat(const char *path, \
130 struct stat43 *ub); } stat43
131 39 NOARGS { pid_t|sys||getppid(void); }
132 40 NOARGS { int|compat_43_sys||lstat(const char *path, \
133 struct stat43 *ub); } lstat43
134 41 NOARGS { int|sys||dup(int fd); }
135 42 NOARGS { int|sys||pipe(void); }
136 43 NOARGS { gid_t|sys||getegid(void); }
137 44 NOARGS { int|sys||profil(void *samples, size_t size, \
138 u_long offset, u_int scale); }
139 #if defined(KTRACE) || !defined(_KERNEL)
140 45 NOARGS { int|sys||ktrace(const char *fname, int ops, \
141 int facs, int pid); }
145 46 STD { int|darwin_sys||sigaction(int signum, \
146 struct darwin___sigaction *nsa, \
147 struct sigaction13 *osa); }
149 47 NOARGS { gid_t|sys||getgid_with_egid(void); } getgid
151 47 NOARGS { gid_t|sys||getgid(void); }
153 48 STD { int|darwin_sys||sigprocmask(int how, \
154 sigset13_t *set, sigset13_t *oset); }
155 49 NOARGS { int|sys||__getlogin(char *namebuf, size_t namelen); }
156 50 NOARGS { int|sys||__setlogin(const char *namebuf); }
157 51 NOARGS { int|sys||acct(const char *path); }
158 52 NOARGS { int|compat_13_sys||sigpending(void); } sigpending13
159 53 NOARGS { int|compat_13_sys||sigaltstack( \
160 const struct sigaltstack13 *nss, \
161 struct sigaltstack13 *oss); } sigaltstack13
162 54 STD { int|darwin_sys||ioctl(int fd, \
163 u_long com, ... void *data); }
164 55 NOARGS { int|sys||reboot(int opt); } oreboot
165 56 NOARGS { int|sys||revoke(const char *path); }
166 57 NOARGS { int|sys||symlink(const char *path, \
168 58 NOARGS { int|sys||readlink(const char *path, \
169 char *buf, size_t count); }
170 59 NOARGS { int|sys||execve(const char *path, \
171 char * const *argp, char * const *envp); }
172 60 NOARGS { mode_t|sys||umask(mode_t newmask); }
173 61 NOARGS { int|sys||chroot(const char *path); }
174 62 NOARGS { int|compat_43_sys||fstat(int fd, \
175 struct stat43 *sb); } fstat43
177 64 NOARGS { int|compat_43_sys||getpagesize(void); } ogetpagesize
178 65 NOARGS { int|compat_12_sys||msync(void *addr, size_t len); }
179 66 STD { int|darwin_sys||vfork(void); }
182 69 NOARGS { int|sys||sbrk(intptr_t incr); }
183 70 NOARGS { int|sys||sstk(int incr); }
184 71 NOARGS { int|sys||mmap(void *addr, size_t len, int prot, \
185 int flags, int fd, long pos); } ommap
186 72 NOARGS { int|sys||ovadvise(int anom); } vadvise
187 73 NOARGS { int|sys||munmap(void *addr, size_t len); }
188 74 NOARGS { int|sys||mprotect(void *addr, size_t len, \
190 75 NOARGS { int|sys||madvise(void *addr, size_t len, \
194 78 NOARGS { int|sys||mincore(void *addr, size_t len, \
196 79 NOARGS { int|sys||getgroups(int gidsetsize, \
198 80 NOARGS { int|sys||setgroups(int gidsetsize, \
199 const gid_t *gidset); }
200 81 NOARGS { int|sys||getpgrp(void); }
201 82 NOARGS { int|sys||setpgid(int pid, int pgid); }
202 83 NOARGS { int|compat_50_sys||setitimer(int which, \
203 const struct itimerval50 *itv, \
204 struct itimerval50 *oitv); }
205 84 NOARGS { int|compat_43_sys||wait(void); } owait
206 85 NOARGS { int|compat_12_sys||swapon(const char *name); }
207 86 NOARGS { int|compat_50_sys||getitimer(int which, \
208 struct itimerval50 *itv); }
209 87 NOARGS { int|compat_43_sys||gethostname(char *hostname, \
210 u_int len); } ogethostname
211 88 NOARGS { int|compat_43_sys||sethostname(char *hostname, \
212 u_int len); } osethostname
213 89 NOARGS { int|compat_43_sys||getdtablesize(void); } \
215 90 NOARGS { int|sys||dup2(int from, int to); }
217 92 NOARGS { int|sys||fcntl(int fd, int cmd, ... void *arg); }
218 93 NOARGS { int|compat_50_sys||select(int nd, fd_set *in, \
219 fd_set *ou, fd_set *ex, struct timeval50 *tv); }
221 95 NOARGS { int|sys||fsync(int fd); }
222 96 NOARGS { int|sys||setpriority(int which, int who, int prio); }
223 97 STD { int|darwin_sys||socket(int domain, \
224 int type, int protocol); }
225 98 STD { int|darwin_sys||connect(int s, \
226 const struct sockaddr *name, \
227 unsigned int namelen); }
228 99 NOARGS { int|compat_43_sys||accept(int s, void *name, \
229 int *anamelen); } oaccept
230 100 NOARGS { int|sys||getpriority(int which, int who); }
231 101 NOARGS { int|compat_43_sys||send(int s, void *buf, int len, \
233 102 NOARGS { int|compat_43_sys||recv(int s, void *buf, int len, \
235 103 STD { int|darwin_sys||sigreturn_x2(struct \
236 darwin_ucontext *uctx); }
237 104 STD { int|darwin_sys||bind(int s, \
238 const struct sockaddr *name, \
239 unsigned int namelen); }
240 105 NOARGS { int|sys||setsockopt(int s, int level, int name, \
241 const void *val, unsigned int valsize); }
242 106 NOARGS { int|sys||listen(int s, int backlog); }
244 108 NOARGS { int|compat_43_sys||sigvec(int signum, \
245 struct sigvec *nsv, struct sigvec *osv); } osigvec
246 109 NOARGS { int|compat_43_sys||sigblock(int mask); } osigblock
247 110 NOARGS { int|compat_43_sys||sigsetmask(int mask); } osigsetmask
248 111 NOARGS { int|compat_13_sys||sigsuspend(int mask); } \
250 112 NOARGS { int|compat_43_sys||sigstack(struct sigstack *nss, \
251 struct sigstack *oss); } osigstack
252 113 NOARGS { int|compat_43_sys||recvmsg(int s, \
253 struct omsghdr *msg, int flags); } orecvmsg
254 114 NOARGS { int|compat_43_sys||sendmsg(int s, void *msg, \
255 int flags); } osendmsg
257 116 NOARGS { int|compat_50_sys||gettimeofday(struct timeval50 *tp, \
258 struct timezone *tzp); }
259 117 NOARGS { int|compat_50_sys||getrusage(int who, \
260 struct rusage50 *rusage); }
261 118 NOARGS { int|sys||getsockopt(int s, int level, int name, \
262 void *val, unsigned int *avalsize); }
264 120 NOARGS { ssize_t|sys||readv(int fd, \
265 const struct iovec *iovp, int iovcnt); }
266 121 NOARGS { ssize_t|sys||writev(int fd, \
267 const struct iovec *iovp, int iovcnt); }
268 122 NOARGS { int|compat_50_sys||settimeofday( \
269 const struct timeval50 *tv, \
270 const struct timezone *tzp); }
271 123 NOARGS { int|sys||fchown(int fd, uid_t uid, gid_t gid); }
272 124 NOARGS { int|sys||fchmod(int fd, mode_t mode); }
273 125 NOARGS { int|compat_43_sys||recvfrom(int s, void *buf, \
274 size_t len, int flags, void *from, \
275 int *fromlenaddr); } orecvfrom
276 126 NOARGS { int|sys||setreuid(uid_t ruid, uid_t euid); }
277 127 NOARGS { int|sys||setregid(gid_t rgid, gid_t egid); }
278 128 NOARGS { int|sys||rename(const char *from, \
280 129 NOARGS { int|compat_43_sys||truncate(const \
281 char *path, long length); } \
283 130 NOARGS { int|compat_43_sys||ftruncate(int fd, \
284 long length); } oftruncate
285 131 NOARGS { int|sys||flock(int fd, int how); }
286 132 NOARGS { int|sys||mkfifo(const char *path, \
288 133 STD { ssize_t|darwin_sys||sendto(int s, const void *buf, \
289 size_t len, int flags, const struct sockaddr *to, \
290 unsigned int tolen); }
291 134 NOARGS { int|sys||shutdown(int s, int how); }
292 135 NOARGS { int|sys||socketpair(int domain, int type, \
293 int protocol, int *rsv); }
294 136 NOARGS { int|sys||mkdir(const char *path, mode_t mode); }
295 137 NOARGS { int|sys||rmdir(const char *path); }
296 138 NOARGS { int|compat_50_sys||utimes(const char *path, \
297 const struct timeval50 *tptr); }
299 140 NOARGS { int|compat_50_sys||adjtime( \
300 const struct timeval50 *delta, \
301 struct timeval50 *olddelta); }
302 141 NOARGS { int|compat_43_sys||getpeername(int fdes, \
303 void *asa, int *alen); } ogetpeername
304 142 NOARGS { int32_t|compat_43_sys||gethostid(void); } ogethostid
306 144 NOARGS { int|compat_43_sys||getrlimit(int which, \
307 struct orlimit *rlp); } ogetrlimit
308 145 NOARGS { int|compat_43_sys||setrlimit(int which, \
309 const struct orlimit *rlp); } osetrlimit
310 146 NOARGS { int|compat_43_sys||killpg(int pgid, int signum); } \
312 147 NOARGS { int|sys||setsid(void); }
315 150 NOARGS { int|compat_43_sys||getsockname(int fdec, \
316 void *asa, int *alen); } ogetsockname
318 152 UNIMPL setprivexec
321 #if defined(NFS) || defined(NFSSERVER) || !defined(_KERNEL)
322 155 NOARGS { int|sys||nfssvc(int flag, void *argp); }
326 156 NOARGS { int|compat_43_sys||getdirentries(int fd, char *buf, \
327 u_int count, long *basep); } ogetdirentries
328 157 STD { int|darwin_sys||statfs(const char *path, \
329 struct darwin_statfs *buf); }
330 158 STD { int|darwin_sys||fstatfs(int fd, \
331 struct darwin_statfs *buf); }
334 #if defined(NFS) || defined(NFSSERVER) || !defined(_KERNEL)
335 161 NOARGS { int|compat_30_sys||getfh(const char *fname, \
340 162 NOARGS { int|compat_09_sys||getdomainname(char *domainname, \
341 int len); } ogetdomainname
342 163 NOARGS { int|compat_09_sys||setdomainname(char *domainname, \
343 int len); } osetdomainname
356 176 UNIMPL add_profil
360 180 STD { int|darwin_sys||kdebug_trace(int debugid, int arg1, \
361 int arg2, int arg3, int arg4, int arg5); }
362 181 NOARGS { int|sys||setgid(gid_t gid); }
363 182 NOARGS { int|sys||setegid(gid_t egid); }
364 183 NOARGS { int|sys||seteuid(uid_t euid); }
365 184 STD { int|darwin_sys||sigreturn(struct \
366 darwin_ucontext *uctx, int ucvers); }
370 188 STD { int|darwin_sys||stat(const char *path, \
371 struct stat12 *ub); } stat12
372 189 STD { int|darwin_sys||fstat(int fd, \
373 struct stat12 *sb); }
374 190 STD { int|darwin_sys||lstat(const char *path, \
375 struct stat12 *ub); } lstat12
376 191 NOARGS { long|sys||pathconf(const char *path, \
378 192 NOARGS { long|sys||fpathconf(int fd, int name); }
380 194 NOARGS { int|sys||getrlimit(int which, \
381 struct rlimit *rlp); }
382 195 NOARGS { int|sys||setrlimit(int which, \
383 const struct rlimit *rlp); }
384 196 NOARGS { int|compat_12_sys||getdirentries(int fd, char *buf, \
385 u_int count, long *basep); }
386 197 NOARGS { void *|sys||mmap(void *addr, size_t len, int prot, \
387 int flags, int fd, long pad, off_t pos); }
389 199 STD { off_t|darwin_sys||lseek(int fd, long off1, \
390 long off2, int whence); }
391 200 NOARGS { int|sys||truncate(const char *path, \
392 int pad, off_t length); }
393 201 NOARGS { int|sys||ftruncate(int fd, int pad, off_t length); }
394 202 STD { int|darwin_sys||__sysctl(int *name, u_int namelen, \
395 void *oldp, size_t *oldlenp, void *newp, \
397 203 NOARGS { int|sys||mlock(const void *addr, size_t len); }
398 204 NOARGS { int|sys||munlock(const void *addr, size_t len); }
399 205 NOARGS { int|sys||undelete(const char *path); }
414 220 STD { int|darwin_sys||getattrlist(const char *path, \
415 struct darwin_attrlist *alist, void *attributes, \
416 size_t buflen, unsigned long options); }
417 221 UNIMPL setattrlist
418 222 UNIMPL getdirentriesattr
419 223 UNIMPL exchangedata
420 224 UNIMPL checkuseraccess
427 231 UNIMPL watchevent
463 267 UNIMPL shm_unlink
466 270 UNIMPL sem_unlink
468 272 UNIMPL sem_trywait
470 274 UNIMPL sem_getvalue
472 276 UNIMPL sem_destroy
492 296 STD { int|darwin_sys||load_shared_file(char *filename, \
493 void *addr, u_long len, void **base, \
494 int count, mach_sf_mapping_t *mappings, \
496 297 UNIMPL reset_shared_file
497 298 UNIMPL new_system_shared_regions
524 325 UNIMPL munlockall
527 328 UNIMPL __pthread_kill
528 329 UNIMPL pthread_sigmask
530 331 STD { void|darwin_sys||pthread_exit(void *value_ptr); }
534 335 STD { int|darwin_sys||utrace(void *addr, size_t len); }
549 350 STD { int|darwin_sys||audit(void *record, int len); }
550 351 STD { int|darwin_sys||auditon(int cmd, \
551 void *data, int len); }
553 353 STD { int|darwin_sys||getauid(darwin_au_id_t *auid); }
554 354 STD { int|darwin_sys||setauid(darwin_au_id_t *auid); }
555 355 STD { int|darwin_sys||getauditinfo(struct \
556 darwin_auditinfo *auditinfo); }
557 356 STD { int|darwin_sys||setauditinfo(struct \
558 darwin_auditinfo *auditinfo); }
559 357 STD { int|darwin_sys||getaudit_addr(struct \
560 darwin_auditinfo_addr *auditinfo_addr, int len); }
561 358 STD { int|darwin_sys||setaudit_addr(struct \
562 darwin_auditinfo_addr *auditinfo_addr, int len); }
563 359 STD { int|darwin_sys||auditctl(char *path); }