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