1 $NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp $ 2 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 4 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 8; 9; We have problems for a few syscalls, specially: 10; 142 ppc_select -> sys_new_select -> sys_select (Conflicts with 82 ???). 11; 12; Expect problems with the following, which have an architecture dependent 13; implementation in Linux/powerpc: 14; 29 pause 15; 42 pipe tested. no problem. 16; 59 olduname 17; 101 ioperm 18; 109 uname 19; 117 ipc 20; 21; Most of syscalls after 182 that were introduced in Linux-2.4 are UNIMPL. 22; 23; The following are UNIMPL here. The Linux kernel implements them but just logs 24; a kernel error and returns -ENOSYS. 25; 110 iopl 26; 113 vm86 27; 123 modify_ldt 28; 198 sys_pciconfig_read 29; 199 sys_pciconfig_write 30; 200 sys_pciconfig_iobase 31; 32; Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr> 33 34; NetBSD powerpc COMPAT_LINUX system call name/number "master" file. 35; (See syscalls.conf to see what it is processed into.) 36; 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. 41; 42; types: 43; STD always included 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. 50; 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). 55; 56; The type-dependent arguments are as follows: 57; For STD, NODEF, NOARGS, and compat syscalls: 58; { pseudo-proto } [alias] 59; For other syscalls: 60; [comment] 61; 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. 64 65#if defined(_KERNEL_OPT) 66#include "opt_compat_netbsd.h" 67#include "opt_compat_43.h" 68#endif 69 70#include <sys/param.h> 71#include <sys/poll.h> 72#include <sys/systm.h> 73#include <sys/signal.h> 74#include <sys/mount.h> 75#include <sys/syscallargs.h> 76 77#include <compat/linux/common/linux_types.h> 78#include <compat/linux/common/linux_signal.h> 79#include <compat/linux/common/linux_siginfo.h> 80#include <compat/linux/common/linux_machdep.h> 81#include <compat/linux/common/linux_mmap.h> 82 83#include <compat/linux/linux_syscallargs.h> 84 850 NOARGS { int linux_sys_nosys(void); } syscall 861 NOARGS { int sys_exit(int rval); } 872 NOARGS { int sys_fork(void); } 883 NOARGS { int sys_read(int fd, char *buf, u_int nbyte); } 894 NOARGS { int sys_write(int fd, char *buf, u_int nbyte); } 905 STD { int linux_sys_open(const char *path, int flags, \ 91 int mode); } 926 NOARGS { int sys_close(int fd); } 937 STD { int linux_sys_waitpid(int pid, int *status, \ 94 int options);} 958 STD { int linux_sys_creat(const char *path, int mode); } 969 STD { int linux_sys_link(const char *path, const char *link); } 9710 STD { int linux_sys_unlink(const char *path); } 9811 STD { int linux_sys_execve(const char *path, char **argp, \ 99 char **envp); } 10012 STD { int linux_sys_chdir(const char *path); } 10113 STD { int linux_sys_time(linux_time_t *t); } 10214 STD { int linux_sys_mknod(const char *path, int mode, \ 103 int dev); } 10415 STD { int linux_sys_chmod(const char *path, int mode); } 10516 STD { int linux_sys_lchown(const char *path, int uid, \ 106 int gid); } 10717 OBSOL break 10818 OBSOL ostat 10919 NOARGS { long compat_43_sys_lseek(int fd, long offset, \ 110 int whence); } 11120 NOARGS MPSAFE { pid_t sys_getpid(void); } 11221 UNIMPL mount 11322 OBSOL umount 11423 NOARGS { int sys_setuid(uid_t uid); } 11524 NOARGS { uid_t sys_getuid(void); } 11625 STD { int linux_sys_stime(linux_time_t *t); } 11726 STD { int linux_sys_ptrace(int request, int pid, \ 118 int addr, int data); } 11927 STD { int linux_sys_alarm(unsigned int secs); } 12028 OBSOL ofstat 12129 STD { int linux_sys_pause(void); } 12230 STD { int linux_sys_utime(const char *path, \ 123 struct linux_utimbuf *times); } 12431 OBSOL stty 12532 OBSOL gtty 12633 STD { int linux_sys_access(const char *path, int flags); } 12734 STD { int linux_sys_nice(int incr); } 12835 OBSOL ftime 12936 NOARGS { int sys_sync(void); } 13037 STD { int linux_sys_kill(int pid, int signum); } 13138 STD { int linux_sys_rename(const char *from, \ 132 const char *to); } 13339 STD { int linux_sys_mkdir(const char *path, int mode); } 13440 STD { int linux_sys_rmdir(const char *path); } 13541 NOARGS { int sys_dup(u_int fd); } 13642 STD { int linux_sys_pipe(int *pfds); } 13743 STD { int linux_sys_times(struct times *tms); } 13844 OBSOL prof 13945 STD { int linux_sys_brk(char *nsize); } 14046 NOARGS { int sys_setgid(gid_t gid); } 14147 NOARGS { gid_t sys_getgid(void); } 14248 STD { int linux_sys_signal(int signum, \ 143 linux_handler_t handler); } 14449 NOARGS { uid_t sys_geteuid(void); } 14550 NOARGS { gid_t sys_getegid(void); } 14651 NOARGS { int sys_acct(char *path); } 14752 UNIMPL umount 14853 OBSOL lock 14954 STD { int linux_sys_ioctl(int fd, u_long com, \ 150 caddr_t data); } 15155 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); } 15256 OBSOL mpx 15357 NOARGS { int sys_setpgid(int pid, int pgid); } 15458 OBSOL ulimit 15559 STD { int linux_sys_olduname(struct linux_old_utsname *up); } 15660 NOARGS { int sys_umask(int newmask); } 15761 NOARGS { int sys_chroot(char *path); } 15862 UNIMPL ustat 15963 NOARGS { int sys_dup2(u_int from, u_int to); } 16064 NOARGS { pid_t sys_getppid(void); } 16165 NOARGS { int sys_getpgrp(void); } 16266 NOARGS { int sys_setsid(void); } 16367 STD { int linux_sys_sigaction(int signum, \ 164 const struct linux_old_sigaction *nsa, \ 165 struct linux_old_sigaction *osa); } 16668 STD { int linux_sys_siggetmask(void); } 16769 STD { int linux_sys_sigsetmask(linux_old_sigset_t mask); } 16870 NOARGS { int sys_setreuid(uid_t ruid, uid_t euid); } 16971 NOARGS { int sys_setregid(gid_t rgid, gid_t egid); } 17072 STD { int linux_sys_sigsuspend(caddr_t restart, \ 171 int oldmask, int mask); } 17273 STD { int linux_sys_sigpending(linux_old_sigset_t *set); } 17374 NOARGS { int compat_43_sys_sethostname(char *hostname, \ 174 u_int len);} 17575 NOARGS { int compat_43_sys_setrlimit(u_int which, \ 176 struct orlimit *rlp); } 17776 NOARGS { int compat_43_sys_getrlimit(u_int which, \ 178 struct orlimit *rlp); } 17977 NOARGS { int sys_getrusage(int who, struct rusage *rusage); } 18078 STD { int linux_sys_gettimeofday(struct timeval *tp, \ 181 struct timezone *tzp); } 18279 STD { int linux_sys_settimeofday(struct timeval *tp, \ 183 struct timezone *tzp); } 18480 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); } 18581 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); } 18682 STD { int linux_sys_select(int nfds, fd_set* readfds, \ 187 fd_set* writefds, fd_set* exceptfds, \ 188 struct timeval *timeout); } 18983 STD { int linux_sys_symlink(const char *path, \ 190 const char *to); } 19184 NOARGS { int compat_43_sys_lstat(const char *path, \ 192 struct stat43 *up); } oolstat 19385 STD { int linux_sys_readlink(const char *name, char *buf, \ 194 int count); } 19586 STD { int linux_sys_uselib(const char *path); } 19687 STD { int linux_sys_swapon(char *name); } 19788 STD { int linux_sys_reboot(int magic1, int magic2, \ 198 int cmd, void *arg); } 19989 STD { int linux_sys_readdir(int fd, caddr_t dent, \ 200 unsigned int count); } 20190 STD { int linux_sys_powerpc_mmap(unsigned long addr, size_t len, \ 202 int prot, int flags, int fd, linux_off_t offset); } 20391 NOARGS { int sys_munmap(caddr_t addr, int len); } 20492 STD { int linux_sys_truncate(const char *path, \ 205 long length); } 20693 NOARGS { int compat_43_sys_ftruncate(int fd, long length); } 20794 NOARGS { int sys_fchmod(int fd, int mode); } 20895 NOARGS { int sys___posix_fchown(int fd, int uid, int gid); } 20996 NOARGS { int sys_getpriority(int which, int who); } 21097 NOARGS { int sys_setpriority(int which, int who, int prio); } 21198 NOARGS { int sys_profil(caddr_t samples, u_int size, \ 212 u_int offset, u_int scale); } 21399 STD { int linux_sys_statfs(const char *path, \ 214 struct linux_statfs *sp); } 215100 STD { int linux_sys_fstatfs(int fd, \ 216 struct linux_statfs *sp); } 217101 STD { int linux_sys_ioperm(unsigned int lo, \ 218 unsigned int hi, int val); } 219102 STD { int linux_sys_socketcall(int what, void *args); } 220103 UNIMPL syslog 221104 NOARGS { int sys_setitimer(u_int which, \ 222 struct itimerval *itv, struct itimerval *oitv); } 223105 NOARGS { int sys_getitimer(u_int which, \ 224 struct itimerval *itv); } 225106 STD { int linux_sys_stat(const char *path, \ 226 struct linux_stat *sp); } 227107 STD { int linux_sys_lstat(const char *path, \ 228 struct linux_stat *sp); } 229108 STD { int linux_sys_fstat(int fd, struct linux_stat *sp); } 230109 STD { int linux_sys_uname(struct linux_utsname *up); } 231110 UNIMPL iopl 232111 UNIMPL vhangup 233112 UNIMPL idle 234113 UNIMPL vm86old 235114 STD { int linux_sys_wait4(int pid, int *status, \ 236 int options, struct rusage *rusage); } 237115 STD { int linux_sys_swapoff(const char *path); } 238116 STD { int linux_sys_sysinfo(struct linux_sysinfo *arg); } 239117 STD { int linux_sys_ipc(int what, int a1, int a2, int a3, \ 240 caddr_t ptr); } 241118 NOARGS { int sys_fsync(int fd); } 242119 STD { int linux_sys_sigreturn(struct linux_sigcontext *scp); } 243120 STD { int linux_sys_clone(int flags, void *stack); } 244121 STD { int linux_sys_setdomainname(char *domainname, \ 245 int len); } 246122 STD { int linux_sys_new_uname(struct linux_utsname *up); } 247123 UNIMPL modify_ldt 248124 UNIMPL adjtimex 249125 NOARGS { int sys_mprotect(caddr_t addr, int len, int prot); } 250126 STD { int linux_sys_sigprocmask(int how, \ 251 const linux_old_sigset_t *set, \ 252 linux_old_sigset_t *oset); } 253127 UNIMPL create_module 254128 UNIMPL init_module 255129 UNIMPL delete_module 256130 UNIMPL get_kernel_syms 257131 UNIMPL quotactl 258132 STD { int linux_sys_getpgid(int pid); } 259133 NOARGS { int sys_fchdir(int fd); } 260134 UNIMPL bdflush 261135 UNIMPL sysfs 262136 STD { int linux_sys_personality(int per); } 263137 UNIMPL afs_syscall 264138 STD { int linux_sys_setfsuid(uid_t uid); } 265139 NOARGS { int linux_sys_getfsuid(void); } 266140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \ 267 u_int32_t olow, caddr_t res, int whence); } 268141 STD { int linux_sys_getdents(int fd, \ 269 struct linux_dirent *dent, unsigned int count); } 270142 STD { int linux_sys_new_select(int nfds, fd_set *readfds, \ 271 fd_set *writefds, fd_set *exceptfds, \ 272 struct timeval *timeout); } 273143 NOARGS { int sys_flock(int fd, int how); } 274144 STD { int linux_sys_msync(caddr_t addr, int len, int fl); } 275145 NOARGS { int sys_readv(int fd, struct iovec *iovp, \ 276 u_int iovcnt); } 277146 NOARGS { int sys_writev(int fd, struct iovec *iovp, \ 278 u_int iovcnt); } 279147 NOARGS { pid_t sys_getsid(pid_t pid); } 280148 STD { int linux_sys_fdatasync(int fd); } 281149 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); } 282150 NOARGS { int sys_mlock(caddr_t addr, size_t len); } 283151 NOARGS { int sys_munlock(caddr_t addr, size_t len); } 284152 NOARGS { int sys_mlockall(int flags); } 285153 NOARGS { int sys_munlockall(void); } 286154 STD { int linux_sys_sched_setparam(pid_t pid, \ 287 const struct linux_sched_param *sp); } 288155 STD { int linux_sys_sched_getparam(pid_t pid, \ 289 struct linux_sched_param *sp); } 290156 STD { int linux_sys_sched_setscheduler(pid_t pid, \ 291 int policy, const struct linux_sched_param *sp); } 292157 STD { int linux_sys_sched_getscheduler(pid_t pid); } 293158 STD { int linux_sys_sched_yield(void); } 294159 STD { int linux_sys_sched_get_priority_max(int policy); } 295160 STD { int linux_sys_sched_get_priority_min(int policy); } 296161 UNIMPL sched_rr_get_interval 297162 NOARGS { int sys_nanosleep(const struct timespec *rqtp, \ 298 struct timespec *rmtp); } 299163 STD { void *linux_sys_mremap(void *old_address, \ 300 size_t old_size, size_t new_size, u_long flags); } 301164 STD { int linux_sys_setresuid(uid_t ruid, uid_t euid, \ 302 uid_t suid); } 303165 STD { int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \ 304 uid_t *suid); } 305166 UNIMPL query_module 306167 NOARGS { int sys_poll(struct pollfd *fds, u_int nfds, \ 307 int timeout); } 308168 UNIMPL nfsservctl 309169 STD { int linux_sys_setresgid(gid_t rgid, gid_t egid, \ 310 gid_t sgid); } 311170 STD { int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \ 312 gid_t *sgid); } 313171 UNIMPL prctl 314172 STD { int linux_sys_rt_sigreturn( \ 315 struct linux_rt_sigframe *sfp); } 316173 STD { int linux_sys_rt_sigaction(int signum, \ 317 const struct linux_sigaction *nsa, \ 318 struct linux_sigaction *osa, \ 319 size_t sigsetsize); } 320174 STD { int linux_sys_rt_sigprocmask(int how, \ 321 const linux_sigset_t *set, \ 322 linux_sigset_t *oset, \ 323 size_t sigsetsize); } 324175 STD { int linux_sys_rt_sigpending( \ 325 linux_sigset_t *set, \ 326 size_t sigsetsize); } 327176 UNIMPL rt_sigtimedwait 328; XXX XAX int here? sigset_t here? siginfo_t 329177 STD { int linux_sys_rt_queueinfo(int pid, int signum, \ 330 void *uinfo); } 331178 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \ 332 size_t sigsetsize); } 333179 STD { int linux_sys_pread(int fd, char *buf, \ 334 size_t nbyte, linux_off_t offset); } 335180 STD { int linux_sys_pwrite(int fd, char *buf, \ 336 size_t nbyte, linux_off_t offset); } 337181 STD { int linux_sys_chown(const char *path, \ 338 int uid, int gid); } 339182 NOARGS { int sys___getcwd(char *bufp, size_t length); } 340183 UNIMPL capget 341184 UNIMPL capset 342185 STD { int linux_sys_sigaltstack( \ 343 const struct linux_sigaltstack *ss, \ 344 struct linux_sigaltstack *oss); } 345186 UNIMPL sendfile 346187 UNIMPL getpmsg 347188 UNIMPL putpmsg 348189 NOARGS { int sys___vfork14(void); } 349190 UNIMPL sys_getrlimit 350191 UNIMPL /* unused */ 351192 UNIMPL mmap2 352193 UNIMPL truncate64 353194 UNIMPL ftruncate64 354195 UNIMPL stat64 355196 UNIMPL lstat64 356197 UNIMPL fstat64 357198 UNIMPL sys_pciconfig_read 358199 UNIMPL sys_pciconfig_write 359200 UNIMPL sys_pciconfig_iobase 360201 UNIMPL /* Unused (MacOnLinux project) */ 361202 UNIMPL sys_getdents64 362203 UNIMPL pivot_root 363204 UNIMPL fcntl64 364205 UNIMPL madvise 365206 UNIMPL mincore 366