591bcef77ef7662ab56e1987c014fc355ad1e8de
[dragonfly.git] / sys / kern / syscalls.master
1 ; @(#)syscalls.master   8.2 (Berkeley) 1/13/94
2 ; $FreeBSD: src/sys/kern/syscalls.master,v 1.72.2.10 2002/07/12 08:22:46 alfred Exp $
3 ;
4 ; System call name/number master file.
5 ; Processed to create kern/init_sysent.c, kern/syscalls.c, sys/syscall.h,
6 ;                     sys/syscall.mk, sys/syscall-hide.h, sys/sysproto.h and
7 ;                     sys/sysunion.h
8
9 ; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments
10 ;       number  system call number, must be in order
11 ;       type    one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT,
12 ;               NODEF, NOARGS, NOPROTO, NOIMPL
13 ;       namespc one of POSIX, BSD, NOHIDE
14 ;       name    pseudo-prototype of syscall routine
15 ;               If one of the following alts is different, then all appear:
16 ;       altname name of system call if different
17 ;       alttag  name of args struct tag if different from [o]`name'"_args"
18 ;       altrtyp return type if not int (bogus - syscalls always return int)
19 ;               for UNIMPL/OBSOL, name continues with comments
20 ;
21 ;       NOTE: All system calls are now called without the MP lock.  Those
22 ;             that need the MP lock will acquire it.
23
24 ; types:
25 ;       STD     always included
26 ;       COMPAT  included on COMPAT #ifdef
27 ;       LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h
28 ;       OBSOL   obsolete, not included in system, only specifies name
29 ;       UNIMPL  not implemented, placeholder only
30
31 ; #ifdef's, etc. may be included, and are copied to the output files.
32
33 #include <sys/param.h>
34 #include <sys/sysent.h>
35 #include <sys/sysproto.h>
36 #include <sys/statvfs.h>
37
38 #ifdef COMPAT_43
39 #include <emulation/43bsd/stat.h>
40 #endif
41
42 #include <emulation/dragonfly12/stat.h>
43
44 ; Reserved/unimplemented system calls in the range 0-150 inclusive
45 ; are reserved for use in future Berkeley releases.
46 ; Additional system calls implemented in vendor and other
47 ; redistributions should be placed in the reserved range at the end
48 ; of the current calls.
49
50 0       STD     NOHIDE  { int nosys(void); } syscall nosys_args int
51 1       STD     NOHIDE  { void exit(int rval); }
52 2       STD     POSIX   { int fork(void); }
53 3       STD     POSIX   { ssize_t read(int fd, void *buf, size_t nbyte); }
54 4       STD     POSIX   { ssize_t write(int fd, const void *buf, size_t nbyte); }
55 5       STD     POSIX   { int open(char *path, int flags, int mode); }
56 ; XXX should be         { int open(const char *path, int flags, ...); }
57 ; but we're not ready for `const' or varargs.
58 ; XXX man page says `mode_t mode'.
59 6       STD     POSIX   { int close(int fd); }
60 7       STD     BSD     { int wait4(int pid, int *status, int options, \
61                             struct rusage *rusage); } wait4 wait_args int
62 8       COMPAT  BSD     { int creat(char *path, int mode); }
63 9       STD     POSIX   { int link(char *path, char *link); }
64 10      STD     POSIX   { int unlink(char *path); }
65 11      OBSOL   NOHIDE  execv
66 12      STD     POSIX   { int chdir(char *path); }
67 13      STD     BSD     { int fchdir(int fd); }
68 14      STD     POSIX   { int mknod(char *path, int mode, int dev); }
69 15      STD     POSIX   { int chmod(char *path, int mode); }
70 16      STD     POSIX   { int chown(char *path, int uid, int gid); }
71 17      STD     BSD     { int obreak(char *nsize); } break obreak_args int
72 18      STD     BSD     { int getfsstat(struct statfs *buf, long bufsize, \
73                             int flags); }
74 19      COMPAT  POSIX   { long lseek(int fd, long offset, int whence); }
75 20      STD     POSIX   { pid_t getpid(void); }
76 21      STD     BSD     { int mount(char *type, char *path, int flags, \
77                             caddr_t data); }
78 ; XXX `path' should have type `const char *' but we're not ready for that.
79 22      STD     BSD     { int unmount(char *path, int flags); }
80 23      STD     POSIX   { int setuid(uid_t uid); }
81 24      STD     POSIX   { uid_t getuid(void); }
82 25      STD     POSIX   { uid_t geteuid(void); }
83 26      STD     BSD     { int ptrace(int req, pid_t pid, caddr_t addr, \
84                             int data); }
85 27      STD     BSD     { int recvmsg(int s, struct msghdr *msg, int flags); }
86 28      STD     BSD     { int sendmsg(int s, caddr_t msg, int flags); }
87 29      STD     BSD     { int recvfrom(int s, caddr_t buf, size_t len, \
88                             int flags, caddr_t from, int *fromlenaddr); }
89 30      STD     BSD     { int accept(int s, caddr_t name, int *anamelen); }
90 31      STD     BSD     { int getpeername(int fdes, caddr_t asa, int *alen); }
91 32      STD     BSD     { int getsockname(int fdes, caddr_t asa, int *alen); }
92 33      STD     POSIX   { int access(char *path, int flags); }
93 34      STD     BSD     { int chflags(char *path, int flags); }
94 35      STD     BSD     { int fchflags(int fd, int flags); }
95 36      STD     BSD     { int sync(void); }
96 37      STD     POSIX   { int kill(int pid, int signum); }
97 38      COMPAT  POSIX   { int stat(char *path, struct ostat *ub); }
98 39      STD     POSIX   { pid_t getppid(void); }
99 40      COMPAT  POSIX   { int lstat(char *path, struct ostat *ub); }
100 41      STD     POSIX   { int dup(u_int fd); }
101 42      STD     POSIX   { int pipe(void); }
102 43      STD     POSIX   { gid_t getegid(void); }
103 44      STD     BSD     { int profil(caddr_t samples, size_t size, \
104                             size_t offset, u_int scale); }
105 45      STD     BSD     { int ktrace(const char *fname, int ops, int facs, \
106                             int pid); }
107 46      OBSOL   NOHIDE  freebsd3_sigaction
108 47      STD     POSIX   { gid_t getgid(void); }
109 48      OBSOL   NOHIDE  freebsd3_sigprocmask
110 ; XXX note nonstandard (bogus) calling convention - the libc stub passes
111 ; us the mask, not a pointer to it, and we return the old mask as the
112 ; (int) return value.
113 49      STD     BSD     { int getlogin(char *namebuf, u_int namelen); }
114 50      STD     BSD     { int setlogin(char *namebuf); }
115 51      STD     BSD     { int acct(char *path); }
116 52      OBSOL   NOHIDE  freebsd3_sigpending
117 53      STD     BSD     { int sigaltstack(stack_t *ss, stack_t *oss); }
118 54      STD     POSIX   { int ioctl(int fd, u_long com, caddr_t data); }
119 55      STD     BSD     { int reboot(int opt); }
120 56      STD     POSIX   { int revoke(char *path); }
121 57      STD     POSIX   { int symlink(char *path, char *link); }
122 58      STD     POSIX   { int readlink(char *path, char *buf, int count); }
123 59      STD     POSIX   { int execve(char *fname, char **argv, char **envv); }
124 60      STD     POSIX   { int umask(int newmask); } umask umask_args int
125 61      STD     BSD     { int chroot(char *path); }
126 62      COMPAT  POSIX   { int fstat(int fd, struct ostat *sb); }
127 63      COMPAT  BSD     { int getkerninfo(int op, char *where, size_t *size, \
128                             int arg); } getkerninfo getkerninfo_args int
129 64      COMPAT  BSD     { int getpagesize(void); } \
130                             getpagesize getpagesize_args int
131 65      STD     BSD     { int msync(void *addr, size_t len, int flags); }
132 66      STD     BSD     { int vfork(void); }
133 67      OBSOL   NOHIDE  vread
134 68      OBSOL   NOHIDE  vwrite
135 69      STD     BSD     { int sbrk(int incr); }
136 70      STD     BSD     { int sstk(int incr); }
137 71      COMPAT  BSD     { int mmap(void *addr, int len, int prot, \
138                             int flags, int fd, long pos); }
139 72      COMPAT  BSD     { int vadvise(int anom); } vadvise ovadvise_args int
140 73      STD     BSD     { int munmap(void *addr, size_t len); }
141 74      STD     BSD     { int mprotect(void *addr, size_t len, int prot); }
142 75      STD     BSD     { int madvise(void *addr, size_t len, int behav); }
143 76      OBSOL   NOHIDE  vhangup
144 77      OBSOL   NOHIDE  vlimit
145 78      STD     BSD     { int mincore(const void *addr, size_t len, \
146                             char *vec); }
147 79      STD     POSIX   { int getgroups(u_int gidsetsize, gid_t *gidset); }
148 80      STD     POSIX   { int setgroups(u_int gidsetsize, gid_t *gidset); }
149 81      STD     POSIX   { int getpgrp(void); }
150 82      STD     POSIX   { int setpgid(int pid, int pgid); }
151 83      STD     BSD     { int setitimer(u_int which, struct itimerval *itv, \
152                             struct itimerval *oitv); }
153 84      COMPAT  BSD     { int wait(void); }
154 85      STD     BSD     { int swapon(char *name); }
155 86      STD     BSD     { int getitimer(u_int which, struct itimerval *itv); }
156 87      COMPAT  BSD     { int gethostname(char *hostname, u_int len); } \
157                             gethostname gethostname_args int
158 88      COMPAT  BSD     { int sethostname(char *hostname, u_int len); } \
159                             sethostname sethostname_args int
160 89      STD     BSD     { int getdtablesize(void); }
161 90      STD     POSIX   { int dup2(u_int from, u_int to); }
162 91      UNIMPL  BSD     getdopt
163 92      STD     POSIX   { int fcntl(int fd, int cmd, long arg); }
164 ; XXX should be         { int fcntl(int fd, int cmd, ...); }
165 ; but we're not ready for varargs.
166 ; XXX man page says `int arg' too.
167 93      STD     BSD     { int select(int nd, fd_set *in, fd_set *ou, \
168                             fd_set *ex, struct timeval *tv); }
169 94      UNIMPL  BSD     setdopt
170 95      STD     POSIX   { int fsync(int fd); }
171 96      STD     BSD     { int setpriority(int which, int who, int prio); }
172 97      STD     BSD     { int socket(int domain, int type, int protocol); }
173 98      STD     BSD     { int connect(int s, caddr_t name, int namelen); }
174 99      CPT_NOA BSD     { int accept(int s, caddr_t name, int *anamelen); } \
175                             accept accept_args int
176 100     STD     BSD     { int getpriority(int which, int who); }
177 101     COMPAT  BSD     { int send(int s, caddr_t buf, int len, int flags); }
178 102     COMPAT  BSD     { int recv(int s, caddr_t buf, int len, int flags); }
179 103     OBSOL   NOHIDE  freebsd3_sigreturn
180 104     STD     BSD     { int bind(int s, caddr_t name, int namelen); }
181 105     STD     BSD     { int setsockopt(int s, int level, int name, \
182                             caddr_t val, int valsize); }
183 106     STD     BSD     { int listen(int s, int backlog); }
184 107     OBSOL   NOHIDE  vtimes
185 108     COMPAT  BSD     { int sigvec(int signum, struct sigvec *nsv, \
186                             struct sigvec *osv); }
187 109     COMPAT  BSD     { int sigblock(int mask); }
188 110     COMPAT  BSD     { int sigsetmask(int mask); }
189 111     OBSOL   NOHIDE  freebsd3_sigsuspend
190 ; XXX note nonstandard (bogus) calling convention - the libc stub passes
191 ; us the mask, not a pointer to it.
192 112     COMPAT  BSD     { int sigstack(struct sigstack *nss, \
193                             struct sigstack *oss); }
194 113     COMPAT  BSD     { int recvmsg(int s, struct omsghdr *msg, int flags); }
195 114     COMPAT  BSD     { int sendmsg(int s, caddr_t msg, int flags); }
196 115     OBSOL   NOHIDE  vtrace
197 116     STD     BSD     { int gettimeofday(struct timeval *tp, \
198                             struct timezone *tzp); }
199 117     STD     BSD     { int getrusage(int who, struct rusage *rusage); }
200 118     STD     BSD     { int getsockopt(int s, int level, int name, \
201                             caddr_t val, int *avalsize); }
202 119     UNIMPL  NOHIDE  resuba (BSD/OS 2.x)
203 120     STD     BSD     { int readv(int fd, struct iovec *iovp, u_int iovcnt); }
204 121     STD     BSD     { int writev(int fd, struct iovec *iovp, \
205                             u_int iovcnt); }
206 122     STD     BSD     { int settimeofday(struct timeval *tv, \
207                             struct timezone *tzp); }
208 123     STD     BSD     { int fchown(int fd, int uid, int gid); }
209 124     STD     BSD     { int fchmod(int fd, int mode); }
210 125     CPT_NOA BSD     { int recvfrom(int s, caddr_t buf, size_t len, \
211                             int flags, caddr_t from, int *fromlenaddr); } \
212                             recvfrom recvfrom_args int
213 126     STD     BSD     { int setreuid(int ruid, int euid); }
214 127     STD     BSD     { int setregid(int rgid, int egid); }
215 128     STD     POSIX   { int rename(char *from, char *to); }
216 129     COMPAT  BSD     { int truncate(char *path, long length); }
217 130     COMPAT  BSD     { int ftruncate(int fd, long length); }
218 131     STD     BSD     { int flock(int fd, int how); }
219 132     STD     POSIX   { int mkfifo(char *path, int mode); }
220 133     STD     BSD     { int sendto(int s, caddr_t buf, size_t len, \
221                             int flags, caddr_t to, int tolen); }
222 134     STD     BSD     { int shutdown(int s, int how); }
223 135     STD     BSD     { int socketpair(int domain, int type, int protocol, \
224                             int *rsv); }
225 136     STD     POSIX   { int mkdir(char *path, int mode); }
226 137     STD     POSIX   { int rmdir(char *path); }
227 138     STD     BSD     { int utimes(char *path, struct timeval *tptr); }
228 139     OBSOL   NOHIDE  4.2 sigreturn
229 140     STD     BSD     { int adjtime(struct timeval *delta, \
230                             struct timeval *olddelta); }
231 141     COMPAT  BSD     { int getpeername(int fdes, caddr_t asa, int *alen); }
232 142     COMPAT  BSD     { long gethostid(void); }
233 143     COMPAT  BSD     { int sethostid(long hostid); }
234 144     COMPAT  BSD     { int getrlimit(u_int which, struct orlimit *rlp); }
235 145     COMPAT  BSD     { int setrlimit(u_int which, struct orlimit *rlp); }
236 146     COMPAT  BSD     { int killpg(int pgid, int signum); }
237 147     STD     POSIX   { int setsid(void); }
238 148     STD     BSD     { int quotactl(char *path, int cmd, int uid, \
239                             caddr_t arg); }
240 149     COMPAT  BSD     { int quota(void); }
241 150     CPT_NOA BSD     { int getsockname(int fdec, caddr_t asa, int *alen); }\
242                             getsockname getsockname_args int
243
244 ; Syscalls 151-180 inclusive are reserved for vendor-specific
245 ; system calls.  (This includes various calls added for compatibity
246 ; with other Unix variants.)
247 ; Some of these calls are now supported by BSD...
248 151     UNIMPL  NOHIDE  sem_lock (BSD/OS 2.x)
249 152     UNIMPL  NOHIDE  sem_wakeup (BSD/OS 2.x)
250 153     UNIMPL  NOHIDE  asyncdaemon (BSD/OS 2.x)
251 154     UNIMPL  NOHIDE  nosys
252 ; 155 is initialized by the NFS code, if present.
253 155     NOIMPL  BSD     { int nfssvc(int flag, caddr_t argp); }
254 156     COMPAT  BSD     { int getdirentries(int fd, char *buf, u_int count, \
255                             long *basep); }
256 157     STD     BSD     { int statfs(char *path, struct statfs *buf); }
257 158     STD     BSD     { int fstatfs(int fd, struct statfs *buf); }
258 159     UNIMPL  NOHIDE  nosys
259 160     UNIMPL  NOHIDE  nosys
260 ; 161 is initialized by the NFS code, if present.
261 161     STD     BSD     { int getfh(char *fname, struct fhandle *fhp); }
262 162     STD     BSD     { int getdomainname(char *domainname, int len); }
263 163     STD     BSD     { int setdomainname(char *domainname, int len); }
264 164     STD     BSD     { int uname(struct utsname *name); }
265 165     STD     BSD     { int sysarch(int op, char *parms); }
266 166     STD     BSD     { int rtprio(int function, pid_t pid, \
267                             struct rtprio *rtp); }
268 167     UNIMPL  NOHIDE  nosys
269 168     UNIMPL  NOHIDE  nosys
270 169     STD     BSD     { int semsys(int which, int a2, int a3, int a4, \
271                             int a5); }
272 ; XXX should be         { int semsys(int which, ...); }
273 170     STD     BSD     { int msgsys(int which, int a2, int a3, int a4, \
274                             int a5, int a6); }
275 ; XXX should be         { int msgsys(int which, ...); }
276 171     STD     BSD     { int shmsys(int which, int a2, int a3, int a4); }
277 ; XXX should be         { int shmsys(int which, ...); }
278 172     UNIMPL  NOHIDE  nosys
279 173     STD     POSIX   { ssize_t extpread(int fd, void *buf, \
280                             size_t nbyte, int flags, off_t offset); }
281 174     STD     POSIX   { ssize_t extpwrite(int fd, const void *buf, \
282                             size_t nbyte, int flags, off_t offset); }
283 175     UNIMPL  NOHIDE  nosys
284 176     STD     BSD     { int ntp_adjtime(struct timex *tp); }
285 177     UNIMPL  NOHIDE  sfork (BSD/OS 2.x)
286 178     UNIMPL  NOHIDE  getdescriptor (BSD/OS 2.x)
287 179     UNIMPL  NOHIDE  setdescriptor (BSD/OS 2.x)
288 180     UNIMPL  NOHIDE  nosys
289
290 ; Syscalls 181-199 are used by/reserved for BSD
291 181     STD     POSIX   { int setgid(gid_t gid); }
292 182     STD     BSD     { int setegid(gid_t egid); }
293 183     STD     BSD     { int seteuid(uid_t euid); }
294 184     UNIMPL  BSD     lfs_bmapv
295 185     UNIMPL  BSD     lfs_markv
296 186     UNIMPL  BSD     lfs_segclean
297 187     UNIMPL  BSD     lfs_segwait
298 188     COMPAT_DF12     POSIX   { int stat(const char *path, struct dfbsd12_stat *ub); }
299 189     COMPAT_DF12     POSIX   { int fstat(int fd, struct dfbsd12_stat *sb); }
300 190     COMPAT_DF12     POSIX   { int lstat(const char *path, struct dfbsd12_stat *ub); }
301 191     STD     POSIX   { int pathconf(char *path, int name); }
302 192     STD     POSIX   { int fpathconf(int fd, int name); }
303 193     UNIMPL  NOHIDE  nosys
304 194     STD     BSD     { int getrlimit(u_int which, \
305                             struct rlimit *rlp); } \
306                             getrlimit __getrlimit_args int
307 195     STD     BSD     { int setrlimit(u_int which, \
308                             struct rlimit *rlp); } \
309                             setrlimit __setrlimit_args int
310 196     COMPAT_DF12     BSD     { int getdirentries(int fd, char *buf, \
311                                     u_int count, long *basep); }
312 197     STD     BSD     { caddr_t mmap(caddr_t addr, size_t len, int prot, \
313                             int flags, int fd, int pad, off_t pos); }
314 198     STD     NOHIDE  { int nosys(void); } __syscall __syscall_args int
315 199     STD     POSIX   { off_t lseek(int fd, int pad, off_t offset, \
316                             int whence); }
317 200     STD     BSD     { int truncate(char *path, int pad, off_t length); }
318 201     STD     BSD     { int ftruncate(int fd, int pad, off_t length); }
319 202     STD     BSD     { int __sysctl(int *name, u_int namelen, void *old, \
320                             size_t *oldlenp, void *new, size_t newlen); } \
321                             __sysctl sysctl_args int
322 ; properly, __sysctl should be a NOHIDE, but making an exception
323 ; here allows to avoid one in libc/sys/Makefile.inc.
324 203     STD     BSD     { int mlock(const void *addr, size_t len); }
325 204     STD     BSD     { int munlock(const void *addr, size_t len); }
326 205     STD     BSD     { int undelete(char *path); }
327 206     STD     BSD     { int futimes(int fd, struct timeval *tptr); }
328 207     STD     BSD     { int getpgid(pid_t pid); }
329 208     UNIMPL  NOHIDE  newreboot (NetBSD)
330 209     STD     BSD     { int poll(struct pollfd *fds, u_int nfds, \
331                             int timeout); }
332
333 ;
334 ; The following are reserved for loadable syscalls
335 ;
336 ; 210 is used by the Checkpoint Module
337 210     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
338 211     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
339 212     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
340 213     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
341 214     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
342 215     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
343 216     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
344 217     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
345 218     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
346 219     NODEF   NOHIDE  lkmnosys lkmnosys nosys_args int
347
348 ;
349 ; The following were introduced with NetBSD/4.4Lite-2
350 ;
351 220     STD     BSD     { int __semctl(int semid, int semnum, int cmd, \
352                             union semun *arg); }
353 221     STD     BSD     { int semget(key_t key, int nsems, int semflg); }
354 222     STD     BSD     { int semop(int semid, struct sembuf *sops, \
355                             u_int nsops); }
356 223     UNIMPL  NOHIDE  semconfig
357 224     STD     BSD     { int msgctl(int msqid, int cmd, \
358                             struct msqid_ds *buf); }
359 225     STD     BSD     { int msgget(key_t key, int msgflg); }
360 226     STD     BSD     { int msgsnd(int msqid, void *msgp, size_t msgsz, \
361                             int msgflg); }
362 227     STD     BSD     { int msgrcv(int msqid, void *msgp, size_t msgsz, \
363                             long msgtyp, int msgflg); }
364 228     STD     BSD     { caddr_t shmat(int shmid, void *shmaddr, int shmflg); }
365 229     STD     BSD     { int shmctl(int shmid, int cmd, \
366                             struct shmid_ds *buf); }
367 230     STD     BSD     { int shmdt(void *shmaddr); }
368 231     STD     BSD     { int shmget(key_t key, int size, int shmflg); }
369 ;
370 232     STD     POSIX   { int clock_gettime(clockid_t clock_id, \
371                             struct timespec *tp); }
372 233     STD     POSIX   { int clock_settime(clockid_t clock_id, \
373                             const struct timespec *tp); }
374 234     STD     POSIX   { int clock_getres(clockid_t clock_id, \
375                             struct timespec *tp); }
376 235     UNIMPL  NOHIDE  timer_create
377 236     UNIMPL  NOHIDE  timer_delete
378 237     UNIMPL  NOHIDE  timer_settime
379 238     UNIMPL  NOHIDE  timer_gettime
380 239     UNIMPL  NOHIDE  timer_getoverrun
381 240     STD     POSIX   { int nanosleep(const struct timespec *rqtp, \
382                             struct timespec *rmtp); }
383 241     UNIMPL  NOHIDE  nosys
384 242     UNIMPL  NOHIDE  nosys
385 243     UNIMPL  NOHIDE  nosys
386 244     UNIMPL  NOHIDE  nosys
387 245     UNIMPL  NOHIDE  nosys
388 246     UNIMPL  NOHIDE  nosys
389 247     UNIMPL  NOHIDE  nosys
390 248     UNIMPL  NOHIDE  nosys
391 249     UNIMPL  NOHIDE  nosys
392 ; syscall numbers initially used in OpenBSD
393 250     STD     BSD     { int minherit(void *addr, size_t len, int inherit); }
394 251     STD     BSD     { int rfork(int flags); }
395 252     STD     BSD     { int openbsd_poll(struct pollfd *fds, u_int nfds, \
396                             int timeout); }
397 253     STD     BSD     { int issetugid(void); }
398 254     STD     BSD     { int lchown(char *path, int uid, int gid); }
399 255     UNIMPL  NOHIDE  nosys
400 256     UNIMPL  NOHIDE  nosys
401 257     UNIMPL  NOHIDE  nosys
402 258     UNIMPL  NOHIDE  nosys
403 259     UNIMPL  NOHIDE  nosys
404 260     UNIMPL  NOHIDE  nosys
405 261     UNIMPL  NOHIDE  nosys
406 262     UNIMPL  NOHIDE  nosys
407 263     UNIMPL  NOHIDE  nosys
408 264     UNIMPL  NOHIDE  nosys
409 265     UNIMPL  NOHIDE  nosys
410 266     UNIMPL  NOHIDE  nosys
411 267     UNIMPL  NOHIDE  nosys
412 268     UNIMPL  NOHIDE  nosys
413 269     UNIMPL  NOHIDE  nosys
414 270     UNIMPL  NOHIDE  nosys
415 271     UNIMPL  NOHIDE  nosys
416 272     COMPAT_DF12     BSD     { int getdents(int fd, char *buf, size_t count); }
417 273     UNIMPL  NOHIDE  nosys
418 274     STD     BSD     { int lchmod(char *path, mode_t mode); }
419 275     NOPROTO BSD     { int lchown(char *path, uid_t uid, gid_t gid); } netbsd_lchown lchown_args int
420 276     STD     BSD     { int lutimes(char *path, struct timeval *tptr); }
421 277     NOPROTO BSD     { int msync(void *addr, size_t len, int flags); } netbsd_msync msync_args int
422 278     OBSOL   BSD     { int nstat(char *path, struct nstat *ub); }
423 279     OBSOL   NOHIDE  { int nfstat(int fd, struct nstat *sb); }
424 280     OBSOL   NOHIDE  { int nlstat(char *path, struct nstat *ub); }
425 281     UNIMPL  NOHIDE  nosys
426 282     UNIMPL  NOHIDE  nosys
427 283     UNIMPL  NOHIDE  nosys
428 284     UNIMPL  NOHIDE  nosys
429 285     UNIMPL  NOHIDE  nosys
430 286     UNIMPL  NOHIDE  nosys
431 287     UNIMPL  NOHIDE  nosys
432 288     UNIMPL  NOHIDE  nosys
433 ; 289 and 290 from NetBSD (OpenBSD: 267 and 268)
434 289     STD     BSD     { ssize_t extpreadv(int fd, struct iovec *iovp, \
435                                   u_int iovcnt, int flags, off_t offset); }
436 290     STD     BSD     { ssize_t extpwritev(int fd, struct iovec *iovp,\
437                                   u_int iovcnt, int flags, off_t offset); }
438 291     UNIMPL  NOHIDE  nosys
439 292     UNIMPL  NOHIDE  nosys
440 293     UNIMPL  NOHIDE  nosys
441 294     UNIMPL  NOHIDE  nosys
442 295     UNIMPL  NOHIDE  nosys
443 296     UNIMPL  NOHIDE  nosys
444 ; XXX 297 is 300 in NetBSD 
445 297     STD     BSD     { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
446 298     STD     BSD     { int fhopen(const struct fhandle *u_fhp, int flags); }
447 299     COMPAT_DF12     POSIX   { int fhstat(const struct fhandle *u_fhp, struct dfbsd12_stat *sb); }
448 ; syscall numbers for FreeBSD
449 300     STD     BSD     { int modnext(int modid); }
450 301     STD     BSD     { int modstat(int modid, struct module_stat* stat); }
451 302     STD     BSD     { int modfnext(int modid); }
452 303     STD     BSD     { int modfind(const char *name); }
453 304     STD     BSD     { int kldload(const char *file); }
454 305     STD     BSD     { int kldunload(int fileid); }
455 306     STD     BSD     { int kldfind(const char *file); }
456 307     STD     BSD     { int kldnext(int fileid); }
457 308     STD     BSD     { int kldstat(int fileid, struct kld_file_stat* stat); }
458 309     STD     BSD     { int kldfirstmod(int fileid); }
459 310     STD     BSD     { int getsid(pid_t pid); }
460 311     STD     BSD     { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
461 312     STD     BSD     { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
462 313     OBSOL   NOHIDE  signanosleep
463 314     STD     BSD     { int aio_return(struct aiocb *aiocbp); }
464 315     STD     BSD     { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
465 316     STD     BSD     { int aio_cancel(int fd, struct aiocb *aiocbp); }
466 317     STD     BSD     { int aio_error(struct aiocb *aiocbp); }
467 318     STD     BSD     { int aio_read(struct aiocb *aiocbp); }
468 319     STD     BSD     { int aio_write(struct aiocb *aiocbp); }
469 320     STD     BSD     { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }
470 321     STD     BSD     { int yield(void); }
471 322     UNIMPL  BSD     thr_sleep
472 323     UNIMPL  BSD     thr_wakeup
473 324     STD     BSD     { int mlockall(int how); }
474 325     STD     BSD     { int munlockall(void); }
475 326     STD     BSD     { int __getcwd(u_char *buf, u_int buflen); }
476
477 327     STD     POSIX   { int sched_setparam (pid_t pid, const struct sched_param *param); }
478 328     STD     POSIX   { int sched_getparam (pid_t pid, struct sched_param *param); }
479
480 329     STD     POSIX   { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
481 330     STD     POSIX   { int sched_getscheduler (pid_t pid); }
482
483 331     STD     POSIX   { int sched_yield (void); }
484 332     STD     POSIX   { int sched_get_priority_max (int policy); }
485 333     STD     POSIX   { int sched_get_priority_min (int policy); }
486 334     STD     POSIX   { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
487 335     STD     BSD     { int utrace(const void *addr, size_t len); }
488 336     OBSOL   NOHIDE  freebsd4_sendfile
489 337     STD     BSD     { int kldsym(int fileid, int cmd, void *data); }
490 338     STD     BSD     { int jail(struct jail *jail); }
491 339     UNIMPL  BSD     pioctl
492 340     STD     POSIX   { int sigprocmask(int how, const sigset_t *set, \
493                             sigset_t *oset); }
494 341     STD     POSIX   { int sigsuspend(const sigset_t *sigmask); }
495 342     STD     POSIX   { int sigaction(int sig, const struct sigaction *act, \
496                             struct sigaction *oact); }
497 343     STD     POSIX   { int sigpending(sigset_t *set); }
498 344     STD     BSD     { int sigreturn(ucontext_t *sigcntxp); }
499 345     STD     POSIX   { int sigtimedwait(const sigset_t *set,\
500                              siginfo_t *info, const struct timespec *timeout); }
501 346     STD     POSIX   { int sigwaitinfo(const sigset_t *set,\
502                              siginfo_t *info); }
503 347     STD     BSD     { int __acl_get_file(const char *path, \
504                             acl_type_t type, struct acl *aclp); }
505 348     STD     BSD     { int __acl_set_file(const char *path, \
506                             acl_type_t type, struct acl *aclp); }
507 349     STD     BSD     { int __acl_get_fd(int filedes, acl_type_t type, \
508                             struct acl *aclp); }
509 350     STD     BSD     { int __acl_set_fd(int filedes, acl_type_t type, \
510                             struct acl *aclp); }
511 351     STD     BSD     { int __acl_delete_file(const char *path, \
512                             acl_type_t type); }
513 352     STD     BSD     { int __acl_delete_fd(int filedes, acl_type_t type); }
514 353     STD     BSD     { int __acl_aclcheck_file(const char *path, \
515                             acl_type_t type, struct acl *aclp); }
516 354     STD     BSD     { int __acl_aclcheck_fd(int filedes, acl_type_t type, \
517                             struct acl *aclp); }
518 355     STD     BSD     { int extattrctl(const char *path, int cmd, \
519                             const char *filename, int attrnamespace, \
520                             const char *attrname); }
521 356     STD     BSD     { int extattr_set_file(const char *path, \
522                             int attrnamespace, const char *attrname, \
523                             void *data, size_t nbytes); }
524 357     STD     BSD     { int extattr_get_file(const char *path, \
525                             int attrnamespace, const char *attrname, \
526                             void *data, size_t nbytes); }
527 358     STD     BSD     { int extattr_delete_file(const char *path, \
528                             int attrnamespace, const char *attrname); }
529 359     STD     BSD     { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }
530 360     STD     BSD     { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
531 361     STD     BSD     { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
532 362     STD     BSD     { int kqueue(void); }
533 363     STD     BSD     { int kevent(int fd, \
534                             const struct kevent *changelist, int nchanges, \
535                             struct kevent *eventlist, int nevents, \
536                             const struct timespec *timeout); }
537 364     STD     BSD     { int sctp_peeloff(int sd, caddr_t name ); }
538 ; 365-392 used by FreeBSD-current
539 365     UNIMPL  NOHIDE  nosys
540 366     UNIMPL  NOHIDE  nosys
541 367     UNIMPL  NOHIDE  nosys
542 368     UNIMPL  NOHIDE  nosys
543 369     UNIMPL  NOHIDE  nosys
544 370     UNIMPL  NOHIDE  nosys
545 371     UNIMPL  NOHIDE  nosys
546 372     UNIMPL  NOHIDE  nosys
547 373     UNIMPL  NOHIDE  nosys
548 374     UNIMPL  NOHIDE  nosys
549 375     UNIMPL  NOHIDE  nosys
550 376     UNIMPL  NOHIDE  nosys
551 377     UNIMPL  NOHIDE  nosys
552 378     UNIMPL  NOHIDE  nosys
553 379     UNIMPL  NOHIDE  nosys
554 380     UNIMPL  NOHIDE  nosys
555 381     UNIMPL  NOHIDE  nosys
556 382     UNIMPL  NOHIDE  nosys
557 383     UNIMPL  NOHIDE  nosys
558 384     UNIMPL  NOHIDE  nosys
559 385     UNIMPL  NOHIDE  nosys
560 386     UNIMPL  NOHIDE  nosys
561 387     UNIMPL  NOHIDE  nosys
562 388     UNIMPL  NOHIDE  nosys
563 389     UNIMPL  NOHIDE  nosys
564 390     UNIMPL  NOHIDE  nosys
565 391     STD     BSD     { int lchflags(char *path, int flags); }
566 392     STD     BSD     { int uuidgen(struct uuid *store, int count); }
567 393     STD     BSD     { int sendfile(int fd, int s, off_t offset, size_t nbytes, \
568                                 struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
569 ; 394-439 used by FreeBSD-current
570 394     UNIMPL  NOHIDE  nosys
571 395     UNIMPL  NOHIDE  nosys
572 396     UNIMPL  NOHIDE  nosys
573 397     UNIMPL  NOHIDE  nosys
574 398     UNIMPL  NOHIDE  nosys
575 399     UNIMPL  NOHIDE  nosys
576 400     UNIMPL  NOHIDE  nosys
577 401     UNIMPL  NOHIDE  nosys
578 402     UNIMPL  NOHIDE  nosys
579 403     UNIMPL  NOHIDE  nosys
580 404     UNIMPL  NOHIDE  nosys
581 405     UNIMPL  NOHIDE  nosys
582 406     UNIMPL  NOHIDE  nosys
583 407     UNIMPL  NOHIDE  nosys
584 408     UNIMPL  NOHIDE  nosys
585 409     UNIMPL  NOHIDE  nosys
586 410     UNIMPL  NOHIDE  nosys
587 411     UNIMPL  NOHIDE  nosys
588 412     UNIMPL  NOHIDE  nosys
589 413     UNIMPL  NOHIDE  nosys
590 414     UNIMPL  NOHIDE  nosys
591 415     UNIMPL  NOHIDE  nosys
592 416     UNIMPL  NOHIDE  nosys
593 417     UNIMPL  NOHIDE  nosys
594 418     UNIMPL  NOHIDE  nosys
595 419     UNIMPL  NOHIDE  nosys
596 420     UNIMPL  NOHIDE  nosys
597 421     UNIMPL  NOHIDE  nosys
598 422     UNIMPL  NOHIDE  nosys
599 423     UNIMPL  NOHIDE  nosys
600 424     UNIMPL  NOHIDE  nosys
601 425     UNIMPL  NOHIDE  nosys
602 426     UNIMPL  NOHIDE  nosys
603 427     UNIMPL  NOHIDE  nosys
604 428     UNIMPL  NOHIDE  nosys
605 429     UNIMPL  NOHIDE  nosys
606 430     UNIMPL  NOHIDE  nosys
607 431     UNIMPL  NOHIDE  nosys
608 432     UNIMPL  NOHIDE  nosys
609 433     UNIMPL  NOHIDE  nosys
610 434     UNIMPL  NOHIDE  nosys
611 435     UNIMPL  NOHIDE  nosys
612 436     UNIMPL  NOHIDE  nosys
613 437     UNIMPL  NOHIDE  nosys
614 438     UNIMPL  NOHIDE  nosys
615 439     UNIMPL  NOHIDE  nosys
616 ; 440-449 reserved for FreeBSD-5.x growth
617 440     UNIMPL  NOHIDE  nosys
618 441     UNIMPL  NOHIDE  nosys
619 442     UNIMPL  NOHIDE  nosys
620 443     UNIMPL  NOHIDE  nosys
621 444     UNIMPL  NOHIDE  nosys
622 445     UNIMPL  NOHIDE  nosys
623 446     UNIMPL  NOHIDE  nosys
624 447     UNIMPL  NOHIDE  nosys
625 448     UNIMPL  NOHIDE  nosys
626 449     UNIMPL  NOHIDE  nosys
627 ; 450 DragonFly system calls
628 450     STD     BSD     { int varsym_set(int level, const char *name, const char *data); }
629 451     STD     BSD     { int varsym_get(int mask, const char *wild, char *buf, int bufsize); }
630 452     STD     BSD     { int varsym_list(int level, char *buf, int maxsize, int *marker); }
631 453     STD     BSD     { int upc_register(struct upcall *upc, void *ctxfunc, void *func, void *data); }
632 454     STD     BSD     { int upc_control(int cmd, int upcid, void *data); }
633 455     STD     BSD     { int caps_sys_service(const char *name, uid_t uid, gid_t gid, int upcid, int flags); }
634 456     STD     BSD     { int caps_sys_client(const char *name, uid_t uid, gid_t gid, int upcid, int flags); }
635 457     STD     BSD     { int caps_sys_close(int portid); }
636 458     STD     BSD     { off_t caps_sys_put(int portid, void *msg, int msgsize); }
637 459     STD     BSD     { int caps_sys_reply(int portid, void *msg, int msgsize, off_t msgcid); }
638 460     STD     BSD     { int caps_sys_get(int portid, void *msg, int maxsize, struct caps_msgid *msgid, struct caps_cred *ccr); }
639 461     STD     BSD     { int caps_sys_wait(int portid, void *msg, int maxsize, struct caps_msgid *msgid, struct caps_cred *ccr); }
640 462     STD     BSD     { int caps_sys_abort(int portid, off_t msgcid, int flags); }
641 463     STD     BSD     { off_t caps_sys_getgen(int portid); }
642 464     STD     BSD     { int caps_sys_setgen(int portid, off_t gen); }
643 465     STD     BSD     { int exec_sys_register(void *entry); }
644 466     STD     BSD     { int exec_sys_unregister(int id); }
645 467     STD     BSD     { int sys_checkpoint(int type, int fd, pid_t pid, int retval); }
646 468     STD     BSD     { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); }
647 469     STD     BSD     { int umtx_sleep(volatile const int *ptr, int value, int timeout); }
648 470     STD     BSD     { int umtx_wakeup(volatile const int *ptr, int count); }
649 471     STD     BSD     { int jail_attach(int jid); }
650 472     STD     BSD     { int set_tls_area(int which, struct tls_info *info, size_t infosize); }
651 473     STD     BSD     { int get_tls_area(int which, struct tls_info *info, size_t infosize); }
652 474     STD     BSD     { int closefrom(int fd); }
653 475     STD     POSIX   { int stat(const char *path, struct stat *ub); }
654 476     STD     POSIX   { int fstat(int fd, struct stat *sb); }
655 477     STD     POSIX   { int lstat(const char *path, struct stat *ub); }
656 478     STD     BSD     { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
657 479     STD     BSD     { int getdirentries(int fd, char *buf, u_int count, \
658                             long *basep); }
659 480     STD     BSD     { int getdents(int fd, char *buf, size_t count); }
660 481     STD     BSD     { int usched_set(pid_t pid, int cmd, void *data, \
661                                 int bytes); }
662 482     STD     BSD     { int extaccept(int s, int flags, caddr_t name, int *anamelen); }
663 483     STD     BSD     { int extconnect(int s, int flags, caddr_t name, int namelen); }
664 484     STD     BSD     { int syslink(int cmd, struct syslink_info *info, size_t bytes); }
665 485     STD     BSD     { int mcontrol(void *addr, size_t len, int behav, off_t value); }
666 486     STD     BSD     { int vmspace_create(void *id, int type, void *data); } 
667 487     STD     BSD     { int vmspace_destroy(void *id); }
668 488     STD     BSD     { int vmspace_ctl(void *id, int cmd,            \
669                                           struct trapframe *tframe,     \
670                                           struct vextframe *vframe); }
671 489     STD     BSD     { int vmspace_mmap(void *id, void *addr, size_t len, \
672                                           int prot, int flags, int fd, \
673                                           off_t offset); }
674 490     STD     BSD     { int vmspace_munmap(void *id, void *addr,      \
675                                           size_t len); }
676 491     STD     BSD     { int vmspace_mcontrol(void *id, void *addr,    \
677                                           size_t len, int behav, off_t value); } 
678 492     STD     BSD     { ssize_t vmspace_pread(void *id, void *buf, \
679                             size_t nbyte, int flags, off_t offset); }
680 493     STD     BSD     { ssize_t vmspace_pwrite(void *id, const void *buf, \
681                             size_t nbyte, int flags, off_t offset); }
682 494     STD     BSD     { void extexit(int how, int status, void *addr); }
683 495     STD     BSD     { int lwp_create(struct lwp_params *params); }
684 496     STD     BSD     { lwpid_t lwp_gettid(void); }
685 497     STD     BSD     { int lwp_kill(pid_t pid, lwpid_t tid, int signum); }
686 498     STD     BSD     { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); }
687 499     STD     BSD     { int pselect(int nd, fd_set *in, fd_set *ou, \
688                             fd_set *ex, const struct timespec *ts,    \
689                             const sigset_t *sigmask); }
690 500     STD     BSD     { int statvfs(const char *path, struct statvfs *buf); }
691 501     STD     BSD     { int fstatvfs(int fd, struct statvfs *buf); }
692 502     STD     BSD     { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); }
693 503     STD     BSD     { int getvfsstat(struct statfs *buf,          \
694                             struct statvfs *vbuf, long vbufsize, int flags); }
695 504     STD     POSIX   { int openat(int fd, char *path, int flags, int mode); }
696 ; XXX should be         { int openat(int fd, const char *path, int flags, ...);}
697 ; but we're not ready for `const' or varargs.
698 ; XXX man page says `mode_t mode'.
699 505     STD     POSIX   { int fstatat(int fd, char *path,       \
700                                         struct stat *sb, int flags); }
701 506     STD     POSIX   { int fchmodat(int fd, char *path, int mode, \
702                                         int flags); }
703 507     STD     POSIX   { int fchownat(int fd, char *path, int uid, int gid, \
704                                         int flags); }
705 508     STD     POSIX   { int unlinkat(int fd, char *path, int flags); }
706 509     STD     POSIX   { int faccessat(int fd, char *path, int amode, \
707                                         int flags); }
708
709 ; POSIX message queues system calls
710 510     STD     POSIX   { mqd_t mq_open(const char * name, int oflag, \
711                                   mode_t mode, struct mq_attr *attr); }
712 511     STD     POSIX   { int mq_close(mqd_t mqdes); }
713 512     STD     POSIX   { int mq_unlink(const char *name); }
714 513     STD     POSIX   { int mq_getattr(mqd_t mqdes, \
715                                   struct mq_attr *mqstat); }
716 514     STD     POSIX   { int mq_setattr(mqd_t mqdes, \
717                                   const struct mq_attr *mqstat, \
718                                   struct mq_attr *omqstat); }
719 515     STD     POSIX   { int mq_notify(mqd_t mqdes, \
720                                   const struct sigevent *notification); }
721 516     STD     POSIX   { int mq_send(mqd_t mqdes, const char *msg_ptr, \
722                                   size_t msg_len, unsigned msg_prio); }
723 517     STD     POSIX   { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \
724                                   size_t msg_len, unsigned *msg_prio); }
725 518     STD     POSIX   { int mq_timedsend(mqd_t mqdes, \
726                                   const char *msg_ptr, size_t msg_len, \
727                                   unsigned msg_prio, \
728                                   const struct timespec *abs_timeout); }
729 519     STD     POSIX   { ssize_t mq_timedreceive(mqd_t mqdes, \
730                                   char *msg_ptr, size_t msg_len, unsigned *msg_prio, \
731                                   const struct timespec *abs_timeout); }
732 520     STD     BSD     { int ioprio_set(int which, int who, int prio); }
733 521     STD     BSD     { int ioprio_get(int which, int who); }
734 522     STD     BSD     { int chroot_kernel(char *path); }