1 $NetBSD: syscalls.master,v 1.36 2009/06/17 14:18:51 njoly Exp $
3 ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
5 ; Derived from NetBSD's sys/compat/linux/arch/powerpc/syscalls.master
6 ; from Linux's arch/mips/kernel/syscalls.h
8 ; NetBSD mips COMPAT_LINUX system call name/number "master" file.
9 ; (See syscalls.conf to see what it is processed into.)
11 ; Expect problems with
12 ; 48 signal: undefined in Linux???
13 ; 86 uselib: needs a.out
15 ; Fields: number type [type-dependent ...]
16 ; number system call number, must be in order
17 ; type one of STD, OBSOL, UNIMPL, NODEF, NOARGS, or one of
18 ; the compatibility options defined in syscalls.conf.
22 ; OBSOL obsolete, not included in system
23 ; UNIMPL unimplemented, not included in system
24 ; NODEF included, but don't define the syscall number
25 ; NOARGS included, but don't define the syscall args structure
26 ; INDIR included, but don't define the syscall args structure
27 ; and allow it to be "really" varargs.
29 ; The compat options are defined in the syscalls.conf file, and the
30 ; compat option name is prefixed to the syscall name. Other than
31 ; that, they're like NODEF (for 'compat' options), or STD (for
32 ; 'libcompat' options).
34 ; The type-dependent arguments are as follows:
35 ; For STD, NODEF, NOARGS, and compat syscalls:
36 ; { pseudo-proto } [alias]
40 ; #ifdef's, etc. may be included, and are copied to the output files.
41 ; #include's are copied to the syscall names and switch definition files only.
43 #include <sys/param.h>
45 #include <sys/systm.h>
46 #include <sys/signal.h>
47 #include <sys/mount.h>
48 #include <sys/syscallargs.h>
50 #include <compat/linux/common/linux_types.h>
51 #include <compat/linux/common/linux_signal.h>
52 #include <compat/linux/common/linux_siginfo.h>
53 #include <compat/linux/common/linux_machdep.h>
54 #include <compat/linux/common/linux_mmap.h>
55 #include <compat/linux/common/linux_socketcall.h>
57 #include <compat/linux/linux_syscallargs.h>
59 0 NOARGS { int|linux_sys||nosys(void); } syscall
60 1 NOARGS { int|sys||exit(int rval); }
61 2 NOARGS { int|sys||fork(void); }
62 3 NOARGS { int|sys||read(int fd, char *buf, u_int nbyte); }
63 4 NOARGS { int|sys||write(int fd, char *buf, u_int nbyte); }
64 5 STD { int|linux_sys||open(const char *path, int flags, \
66 6 NOARGS { int|sys||close(int fd); }
67 7 STD { int|linux_sys||waitpid(int pid, int *status, \
69 8 STD { int|linux_sys||creat(const char *path, int mode); }
70 9 NOARGS { int|sys||link(const char *path, const char *link); }
71 10 STD { int|linux_sys||unlink(const char *path); }
72 11 NOARGS { int|sys||execve(const char *path, char **argp, \
74 12 NOARGS { int|sys||chdir(const char *path); }
75 13 STD { int|linux_sys||time(linux_time_t *t); }
76 14 STD { int|linux_sys||mknod(const char *path, int mode, \
78 15 NOARGS { int|sys||chmod(const char *path, int mode); }
79 16 NOARGS { int|sys||__posix_lchown(const char *path, int uid, \
83 19 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \
85 20 NOARGS { pid_t|sys||getpid(void); }
88 23 NOARGS { int|sys||setuid(uid_t uid); }
89 24 NOARGS { uid_t|sys||getuid(void); }
90 25 STD { int|linux_sys||stime(linux_time_t *t); }
91 26 STD { int|linux_sys||ptrace(int request, int pid, \
92 int addr, int data); }
93 27 STD { int|linux_sys||alarm(unsigned int secs); }
95 29 STD { int|linux_sys||pause(void); }
96 30 STD { int|linux_sys||utime(const char *path, \
97 struct linux_utimbuf *times); }
100 33 NOARGS { int|sys||access(const char *path, int flags); }
101 34 STD { int|linux_sys||nice(int incr); }
103 36 NOARGS { int|sys||sync(void); }
104 37 STD { int|linux_sys||kill(int pid, int signum); }
105 38 NOARGS { int|sys||__posix_rename(const char *from, \
107 39 NOARGS { int|sys||mkdir(const char *path, int mode); }
108 40 NOARGS { int|sys||rmdir(const char *path); }
109 41 NOARGS { int|sys||dup(u_int fd); }
110 42 STD { int|linux_sys||pipe(int *pfds); }
111 43 STD { int|linux_sys||times(struct times *tms); }
113 45 STD { int|linux_sys||brk(char *nsize); }
114 46 NOARGS { int|sys||setgid(gid_t gid); }
115 47 NOARGS { gid_t|sys||getgid(void); }
116 48 STD { int|linux_sys||signal(int signum, \
117 linux___sighandler_t handler); }
118 49 NOARGS { uid_t|sys||geteuid(void); }
119 50 NOARGS { gid_t|sys||getegid(void); }
120 51 NOARGS { int|sys||acct(char *path); }
123 54 STD { int|linux_sys||ioctl(int fd, u_long com, \
125 55 STD { int|linux_sys||fcntl(int fd, int cmd, void *arg); }
127 57 NOARGS { int|sys||setpgid(int pid, int pgid); }
129 59 STD { int|linux_sys||olduname(struct linux_old_utsname \
131 60 NOARGS { int|sys||umask(int newmask); }
132 61 NOARGS { int|sys||chroot(char *path); }
134 63 NOARGS { int|sys||dup2(u_int from, u_int to); }
135 64 NOARGS { pid_t|sys||getppid(void); }
136 65 NOARGS { int|sys||getpgrp(void); }
137 66 NOARGS { int|sys||setsid(void); }
138 67 STD { int|linux_sys||sigaction(int signum, \
139 const struct linux_old_sigaction *nsa, \
140 struct linux_old_sigaction *osa); }
141 68 STD { int|linux_sys||siggetmask(void); }
142 69 STD { int|linux_sys||sigsetmask(linux_old_sigset_t mask); }
143 70 NOARGS { int|sys||setreuid(uid_t ruid, uid_t euid); }
144 71 NOARGS { int|sys||setregid(gid_t rgid, gid_t egid); }
145 72 STD { int|linux_sys||sigsuspend(void *restart, \
146 int oldmask, int mask); }
147 73 STD { int|linux_sys||sigpending(linux_old_sigset_t *set); }
148 74 NOARGS { int|compat_43_sys||sethostname(char *hostname, \
150 75 STD { int|linux_sys||setrlimit(u_int which, \
151 struct orlimit *rlp); }
152 76 STD { int|linux_sys||getrlimit(u_int which, \
153 struct orlimit *rlp); }
154 77 NOARGS { int|compat_50_sys||getrusage(int who, \
155 struct rusage50 *rusage); }
156 78 STD { int|linux_sys||gettimeofday(struct timeval50 *tp, \
157 struct timezone *tzp); }
158 79 STD { int|linux_sys||settimeofday(struct timeval50 *tp, \
159 struct timezone *tzp); }
160 80 NOARGS { int|sys||getgroups(u_int gidsetsize, gid_t *gidset); }
161 81 NOARGS { int|sys||setgroups(u_int gidsetsize, gid_t *gidset); }
163 83 NOARGS { int|sys||symlink(const char *path, const char *to); }
164 84 NOARGS { int|compat_43_sys||lstat(const char *path, \
165 struct stat43 *up); } oolstat
166 85 NOARGS { int|sys||readlink(const char *name, char *buf, \
169 ;86 STD { int|linux_sys||uselib(const char *path); }
170 87 STD { int|linux_sys||swapon(char *name); }
171 88 STD { int|linux_sys||reboot(int magic1, int magic2, \
172 int cmd, void *arg); }
173 89 STD { int|linux_sys||readdir(int fd, void *dent, \
174 unsigned int count); }
175 90 NOARGS { int|linux_sys||mmap(unsigned long addr, size_t len, \
176 int prot, int flags, int fd, linux_off_t offset); }
177 91 NOARGS { int|sys||munmap(void *addr, int len); }
178 92 NOARGS { int|compat_43_sys||truncate(const char *path, \
180 93 NOARGS { int|compat_43_sys||ftruncate(int fd, long length); }
181 94 NOARGS { int|sys||fchmod(int fd, int mode); }
182 95 NOARGS { int|sys||__posix_fchown(int fd, int uid, int gid); }
183 96 STD { int|linux_sys||getpriority(int which, int who); }
184 97 NOARGS { int|sys||setpriority(int which, int who, int prio); }
186 99 STD { int|linux_sys||statfs(const char *path, \
187 struct linux_statfs *sp); }
188 100 STD { int|linux_sys||fstatfs(int fd, \
189 struct linux_statfs *sp); }
190 101 STD { int|linux_sys||ioperm(unsigned int lo, \
191 unsigned int hi, int val); }
192 102 STD { int|linux_sys||socketcall(int what, void *args); }
194 104 NOARGS { int|compat_50_sys||setitimer(u_int which, \
195 struct itimerval50 *itv, \
196 struct itimerval50 *oitv); }
197 105 NOARGS { int|compat_50_sys||getitimer(u_int which, \
198 struct itimerval50 *itv); }
199 106 STD { int|linux_sys||stat(const char *path, \
200 struct linux_stat *sp); }
201 107 STD { int|linux_sys||lstat(const char *path, \
202 struct linux_stat *sp); }
203 108 STD { int|linux_sys||fstat(int fd, struct linux_stat *sp); }
204 109 STD { int|linux_sys||uname(struct linux_utsname *up); }
209 114 STD { int|linux_sys||wait4(int pid, int *status, \
210 int options, struct rusage50 *rusage); }
211 115 STD { int|linux_sys||swapoff(const char *path); }
212 116 STD { int|linux_sys||sysinfo(struct linux_sysinfo *arg); }
213 117 STD { int|linux_sys||ipc(int what, int a1, int a2, int a3, \
215 118 NOARGS { int|sys||fsync(int fd); }
216 119 STD { int|linux_sys||sigreturn(struct linux_sigframe *sf); }
217 120 STD { int|linux_sys||clone(int flags, void *stack); }
218 121 STD { int|linux_sys||setdomainname(char *domainname, \
220 122 STD { int|linux_sys||new_uname(struct linux_utsname *up); }
221 123 UNIMPL modify_ldt
223 125 STD { int|linux_sys||mprotect(const void *start, \
224 unsigned long len, int prot); }
225 126 STD { int|linux_sys||sigprocmask(int how, \
226 const linux_old_sigset_t *set, \
227 linux_old_sigset_t *oset); }
228 127 UNIMPL create_module
229 128 UNIMPL init_module
230 129 UNIMPL delete_module
231 130 UNIMPL get_kernel_syms
233 132 NOARGS { pid_t|sys||getpgid(pid_t pid); }
234 133 NOARGS { int|sys||fchdir(int fd); }
237 136 STD { int|linux_sys||personality(unsigned long per); }
238 137 UNIMPL afs_syscall
239 138 STD { int|linux_sys||setfsuid(uid_t uid); }
240 139 STD { int|linux_sys||setfsgid(gid_t gid); }
241 140 STD { int|linux_sys||llseek(int fd, u_int32_t ohigh, \
242 u_int32_t olow, void *res, int whence); }
243 141 STD { int|linux_sys||getdents(int fd, \
244 struct linux_dirent *dent, unsigned int count); }
245 142 STD { int|linux_sys||select(int nfds, fd_set *readfds, \
246 fd_set *writefds, fd_set *exceptfds, \
247 struct timeval50 *timeout); }
248 143 NOARGS { int|sys||flock(int fd, int how); }
249 144 NOARGS { int|sys|13|msync(void *addr, size_t len, int flags); }
250 145 NOARGS { int|sys||readv(int fd, struct iovec *iovp, \
252 146 NOARGS { int|sys||writev(int fd, struct iovec *iovp, \
254 147 STD { int|linux_sys||cacheflush(void *addr, \
255 int bytes, int cache); }
257 149 STD { int|linux_sys||sysmips(int cmd, int arg1, \
258 int arg2, int arg3); }
260 151 NOARGS { pid_t|sys||getsid(pid_t pid); }
261 152 STD { int|linux_sys||fdatasync(int fd); }
262 153 STD { int|linux_sys||__sysctl(struct linux___sysctl *lsp); }
263 154 NOARGS { int|sys||mlock(void *addr, size_t len); }
264 155 NOARGS { int|sys||munlock(void *addr, size_t len); }
265 156 NOARGS { int|sys||mlockall(int flags); }
266 157 NOARGS { int|sys||munlockall(void); }
267 158 STD { int|linux_sys||sched_setparam(pid_t pid, \
268 const struct linux_sched_param *sp); }
269 159 STD { int|linux_sys||sched_getparam(pid_t pid, \
270 struct linux_sched_param *sp); }
271 160 STD { int|linux_sys||sched_setscheduler(pid_t pid, \
272 int policy, const struct linux_sched_param *sp); }
273 161 STD { int|linux_sys||sched_getscheduler(pid_t pid); }
274 162 STD { int|linux_sys||sched_yield(void); }
275 163 STD { int|linux_sys||sched_get_priority_max(int policy); }
276 164 STD { int|linux_sys||sched_get_priority_min(int policy); }
277 165 UNIMPL sched_rr_get_interval
278 166 STD { int|linux_sys||nanosleep( \
279 const struct linux_timespec *rqtp, \
280 struct linux_timespec *rmtp); }
281 167 STD { void *|linux_sys||mremap(void *old_address, \
282 size_t old_size, size_t new_size, u_long flags); }
283 168 NOARGS { int|linux_sys||accept(int s, \
284 struct osockaddr *name, int *anamelen); }
285 169 NOARGS { int|linux_sys||bind(int s, \
286 const struct osockaddr *name, int namelen); }
287 170 NOARGS { int|linux_sys||connect(int s, \
288 const struct sockaddr *name, int namelen); }
289 171 NOARGS { int|linux_sys||getpeername(int fdes, void *asa, \
291 172 NOARGS { int|linux_sys||getsockname(int fdes, void *asa, \
293 173 NOARGS { int|linux_sys||getsockopt(int s, int level, \
294 int optname, void *optval, int *optlen); }
295 174 NOARGS { int|sys||listen(int s, int backlog); }
296 175 NOARGS { int|linux_sys||recv(int s, void *buf, int len, \
298 176 NOARGS { int|linux_sys||recvfrom(int s, void *buf, int len, \
299 int flags, struct osockaddr *from, \
301 177 NOARGS { int|linux_sys||recvmsg(int s, \
302 struct linux_msghdr *msg, u_int flags); }
303 178 NOARGS { int|linux_sys||send(int s, void *buf, int len, \
305 179 NOARGS { int|linux_sys||sendmsg(int s, \
306 struct linux_msghdr *msg, u_int flags); }
307 180 NOARGS { int|linux_sys||sendto(int s, void *msg, \
308 int len, int flags, struct osockaddr *to, \
310 181 NOARGS { int|linux_sys||setsockopt(int s, int level, \
311 int optname, void *optval, int optlen); }
313 183 NOARGS { int|linux_sys||socket(int domain, int type, \
315 184 NOARGS { int|linux_sys||socketpair(int domain, int type, \
316 int protocol, int *rsv); }
317 185 STD { int|linux_sys||setresuid(uid_t ruid, uid_t euid, \
319 186 STD { int|linux_sys||getresuid(uid_t *ruid, uid_t *euid, \
321 187 UNIMPL query_module
322 188 NOARGS { int|sys||poll(struct pollfd *fds, u_int nfds, \
324 189 UNIMPL nfsservctl
325 190 STD { int|linux_sys||setresgid(gid_t rgid, gid_t egid, \
327 191 STD { int|linux_sys||getresgid(gid_t *rgid, gid_t *egid, \
330 193 STD { int|linux_sys||rt_sigreturn( \
331 struct linux_pt_regs regs); }
332 194 STD { int|linux_sys||rt_sigaction(int signum, \
333 const struct linux_sigaction *nsa, \
334 struct linux_sigaction *osa, \
335 size_t sigsetsize); }
336 195 STD { int|linux_sys||rt_sigprocmask(int how, \
337 const linux_sigset_t *set, \
338 linux_sigset_t *oset, \
339 size_t sigsetsize); }
340 196 STD { int|linux_sys||rt_sigpending( \
341 linux_sigset_t *set, \
342 size_t sigsetsize); }
343 197 UNIMPL rt_sigtimedwait
344 198 STD { int|linux_sys||rt_queueinfo(int pid, int signum, \
345 linux_siginfo_t *uinfo); }
346 199 STD { int|linux_sys||rt_sigsuspend(linux_sigset_t *unewset, \
347 size_t sigsetsize); }
348 200 STD { int|linux_sys||pread(int fd, char *buf, \
349 size_t nbyte, linux_off_t offset); }
350 201 STD { int|linux_sys||pwrite(int fd, char *buf, \
351 size_t nbyte, linux_off_t offset); }
352 202 NOARGS { int|sys||__posix_chown(const char *path, \
354 203 NOARGS { int|sys||__getcwd(char *bufp, size_t length); }
357 206 STD { int|linux_sys||sigaltstack( \
358 const struct linux_sigaltstack *ss, \
359 struct linux_sigaltstack *oss); }
363 #define linux_sys_mmap2_args linux_sys_mmap_args
364 210 NOARGS { linux_off_t|linux_sys||mmap2(unsigned long addr, \
365 size_t len, int prot, int flags, int fd, \
366 linux_off_t offset); }
367 211 STD { int|linux_sys||truncate64(const char *path, \
369 212 STD { int|linux_sys||ftruncate64(unsigned int fd, \
371 213 STD { int|linux_sys||stat64(const char *path, \
372 struct linux_stat64 *sp); }
373 214 STD { int|linux_sys||lstat64(const char *path, \
374 struct linux_stat64 *sp); }
375 215 STD { int|linux_sys||fstat64(int fd, \
376 struct linux_stat64 *sp); }
377 216 UNIMPL pivot_root
378 217 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); }
379 218 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); }
380 219 STD { int|linux_sys||getdents64(int fd, \
381 struct linux_dirent64 *dent, unsigned int count); }
382 220 STD { int|linux_sys||fcntl64(int fd, \
383 int cmd, void *arg); }
384 221 UNIMPL /* reserved */
387 224 STD { int|linux_sys||setxattr(char *path, char *name, \
388 void *value, size_t size, int flags); }
389 225 STD { int|linux_sys||lsetxattr(char *path, char *name, \
390 void *value, size_t size, int flags); }
391 226 STD { int|linux_sys||fsetxattr(int fd, char *name, \
392 void *value, size_t size, int flags); }
393 227 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \
394 void *value, size_t size); }
395 228 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \
396 void *value, size_t size); }
397 229 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \
398 void *value, size_t size); }
399 230 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \
401 231 STD { ssize_t|linux_sys||llistxattr(char *path, char *list, \
403 232 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \
405 233 STD { int|linux_sys||removexattr(char *path, char *name); }
406 234 STD { int|linux_sys||lremovexattr(char *path, char *name); }
407 235 STD { int|linux_sys||fremovexattr(int fd, char *name); }
409 237 UNIMPL sendfile64
411 239 UNIMPL sched_setaffinity
412 240 UNIMPL sched_getaffinity
414 242 UNIMPL io_destroy
415 243 UNIMPL io_getevents
418 246 STD { int|linux_sys||exit_group(int error_code); }
419 247 UNIMPL lookup_dcookie
420 248 UNIMPL epoll_create
422 250 UNIMPL epoll_wait
423 251 UNIMPL remap_file_pages
424 252 UNIMPL set_tid_address
425 253 UNIMPL restart_syscall
427 255 STD { int|linux_sys||statfs64(const char *path, \
428 size_t sz, struct linux_statfs64 *sp); }
429 256 STD { int|linux_sys||fstatfs64(int fd, \
430 size_t sz, struct linux_statfs64 *sp); }
431 257 UNIMPL timer_create
432 258 UNIMPL timer_settime
433 259 UNIMPL timer_gettime
434 260 UNIMPL timer_getoverrun
435 261 UNIMPL timer_delete
436 262 STD { int|linux_sys||clock_settime(clockid_t which, \
437 struct linux_timespec *tp); }
438 263 STD { int|linux_sys||clock_gettime(clockid_t which, \
439 struct linux_timespec *tp); }
440 264 STD { int|linux_sys||clock_getres(clockid_t which, \
441 struct linux_timespec *tp); }
442 265 STD { int|linux_sys||clock_nanosleep(clockid_t which, \
443 int flags, struct linux_timespec *rqtp, \
444 struct linux_timespec *rmtp); }
448 269 UNIMPL get_mempolicy
449 270 UNIMPL set_mempolicy
452 273 UNIMPL mq_timedsend
453 274 UNIMPL mq_timedreceive
455 276 UNIMPL mq_getsetattr