1 $NetBSD: syscalls.master,v 1.13 2002/05/19 17:55:42 jdolecek 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 \ 97 char *link); } 9810 STD { int linux_sys_unlink(const char *path); } 9911 STD { int linux_sys_execve(const char *path, char **argp, \ 100 char **envp); } 10112 STD { int linux_sys_chdir(const char *path); } 10213 STD { int linux_sys_time(linux_time_t *t); } 10314 STD { int linux_sys_mknod(const char *path, int mode, \ 104 int dev); } 10515 STD { int linux_sys_chmod(const char *path, int mode); } 10616 STD { int linux_sys_lchown(const char *path, int uid, \ 107 int gid); } 10817 OBSOL break 10918 OBSOL ostat 11019 NOARGS { long compat_43_sys_lseek(int fd, long offset, \ 111 int whence); } 11220 NOARGS MPSAFE { pid_t sys_getpid(void); } 11321 UNIMPL mount 11422 OBSOL umount 11523 NOARGS { int sys_setuid(uid_t uid); } 11624 NOARGS { uid_t sys_getuid(void); } 11725 STD { int linux_sys_stime(linux_time_t *t); } 11826 STD { int linux_sys_ptrace(int request, int pid, \ 119 int addr, int data); } 12027 STD { int linux_sys_alarm(unsigned int secs); } 12128 OBSOL ofstat 12229 STD { int linux_sys_pause(void); } 12330 STD { int linux_sys_utime(const char *path, \ 124 struct linux_utimbuf *times); } 12531 OBSOL stty 12632 OBSOL gtty 12733 STD { int linux_sys_access(const char *path, int flags); } 12834 STD { int linux_sys_nice(int incr); } 12935 OBSOL ftime 13036 NOARGS { int sys_sync(void); } 13137 STD { int linux_sys_kill(int pid, int signum); } 13238 STD { int linux_sys_rename(const char *from, \ 133 const char *to); } 13439 STD { int linux_sys_mkdir(const char *path, int mode); } 13540 STD { int linux_sys_rmdir(const char *path); } 13641 NOARGS { int sys_dup(u_int fd); } 13742 STD { int linux_sys_pipe(int *pfds); } 13843 STD { int linux_sys_times(struct times *tms); } 13944 OBSOL prof 14045 STD { int linux_sys_brk(char *nsize); } 14146 NOARGS { int sys_setgid(gid_t gid); } 14247 NOARGS { gid_t sys_getgid(void); } 14348 STD { int linux_sys_signal(int signum, \ 144 linux_handler_t handler); } 14549 NOARGS { uid_t sys_geteuid(void); } 14650 NOARGS { gid_t sys_getegid(void); } 14751 NOARGS { int sys_acct(char *path); } 14852 UNIMPL umount 14953 OBSOL lock 15054 STD { int linux_sys_ioctl(int fd, u_long com, \ 151 caddr_t data); } 15255 STD { int linux_sys_fcntl(int fd, int cmd, void *arg); } 15356 OBSOL mpx 15457 NOARGS { int sys_setpgid(int pid, int pgid); } 15558 OBSOL ulimit 15659 STD { int linux_sys_olduname(struct linux_old_utsname \ 157 *up); } 15860 NOARGS { int sys_umask(int newmask); } 15961 NOARGS { int sys_chroot(char *path); } 16062 UNIMPL ustat 16163 NOARGS { int sys_dup2(u_int from, u_int to); } 16264 NOARGS { pid_t sys_getppid(void); } 16365 NOARGS { int sys_getpgrp(void); } 16466 NOARGS { int sys_setsid(void); } 16567 STD { int linux_sys_sigaction(int signum, \ 166 const struct linux_old_sigaction *nsa, \ 167 struct linux_old_sigaction *osa); } 16868 STD { int linux_sys_siggetmask(void); } 16969 STD { int linux_sys_sigsetmask(linux_old_sigset_t mask); } 17070 NOARGS { int sys_setreuid(uid_t ruid, uid_t euid); } 17171 NOARGS { int sys_setregid(gid_t rgid, gid_t egid); } 17272 STD { int linux_sys_sigsuspend(caddr_t restart, \ 173 int oldmask, int mask); } 17473 STD { int linux_sys_sigpending(linux_old_sigset_t *set); } 17574 NOARGS { int compat_43_sys_sethostname(char *hostname, \ 176 u_int len);} 17775 STD { int linux_sys_setrlimit(u_int which, \ 178 struct orlimit *rlp); } 17976 STD { int linux_sys_getrlimit(u_int which, \ 180 struct orlimit *rlp); } 18177 NOARGS { int sys_getrusage(int who, struct rusage *rusage); } 18278 STD { int linux_sys_gettimeofday(struct timeval *tp, \ 183 struct timezone *tzp); } 18479 STD { int linux_sys_settimeofday(struct timeval *tp, \ 185 struct timezone *tzp); } 18680 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); } 18781 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); } 18882 STD { int linux_sys_select(int nfds, fd_set* readfds, \ 189 fd_set* writefds, fd_set* exceptfds, \ 190 struct timeval *timeout); } 19183 STD { int linux_sys_symlink(const char *path, \ 192 const char *to); } 19384 NOARGS { int compat_43_sys_lstat(const char *path, \ 194 struct stat43 *up); } oolstat 19585 STD { int linux_sys_readlink(const char *name, char *buf, \ 196 int count); } 19786 STD { int linux_sys_uselib(const char *path); } 19887 STD { int linux_sys_swapon(char *name); } 19988 STD { int linux_sys_reboot(int magic1, int magic2, \ 200 int cmd, void *arg); } 20189 STD { int linux_sys_readdir(int fd, caddr_t dent, \ 202 unsigned int count); } 20390 NOARGS { int linux_sys_mmap(unsigned long addr, size_t len, \ 204 int prot, int flags, int fd, linux_off_t offset); } 20591 NOARGS { int sys_munmap(caddr_t addr, int len); } 20692 STD { int linux_sys_truncate(const char *path, \ 207 long length); } 20893 NOARGS { int compat_43_sys_ftruncate(int fd, long length); } 20994 NOARGS { int sys_fchmod(int fd, int mode); } 21095 NOARGS { int sys___posix_fchown(int fd, int uid, int gid); } 21196 NOARGS { int sys_getpriority(int which, int who); } 21297 NOARGS { int sys_setpriority(int which, int who, int prio); } 21398 NOARGS { int sys_profil(caddr_t samples, u_int size, \ 214 u_int offset, u_int scale); } 21599 STD { int linux_sys_statfs(const char *path, \ 216 struct linux_statfs *sp); } 217100 STD { int linux_sys_fstatfs(int fd, \ 218 struct linux_statfs *sp); } 219101 STD { int linux_sys_ioperm(unsigned int lo, \ 220 unsigned int hi, int val); } 221102 STD { int linux_sys_socketcall(int what, void *args); } 222103 UNIMPL syslog 223104 NOARGS { int sys_setitimer(u_int which, \ 224 struct itimerval *itv, struct itimerval *oitv); } 225105 NOARGS { int sys_getitimer(u_int which, \ 226 struct itimerval *itv); } 227106 STD { int linux_sys_stat(const char *path, \ 228 struct linux_stat *sp); } 229107 STD { int linux_sys_lstat(const char *path, \ 230 struct linux_stat *sp); } 231108 STD { int linux_sys_fstat(int fd, struct linux_stat *sp); } 232109 STD { int linux_sys_uname(struct linux_utsname *up); } 233110 UNIMPL iopl 234111 UNIMPL vhangup 235112 UNIMPL idle 236113 UNIMPL vm86old 237114 STD { int linux_sys_wait4(int pid, int *status, \ 238 int options, struct rusage *rusage); } 239115 STD { int linux_sys_swapoff(const char *path); } 240116 STD { int linux_sys_sysinfo(struct linux_sysinfo *arg); } 241117 STD { int linux_sys_ipc(int what, int a1, int a2, int a3, \ 242 caddr_t ptr); } 243118 NOARGS { int sys_fsync(int fd); } 244119 STD { int linux_sys_sigreturn(struct linux_sigcontext *scp); } 245120 STD { int linux_sys_clone(int flags, void *stack); } 246121 STD { int linux_sys_setdomainname(char *domainname, \ 247 int len); } 248122 STD { int linux_sys_new_uname(struct linux_utsname *up); } 249123 UNIMPL modify_ldt 250124 UNIMPL adjtimex 251125 STD { int linux_sys_mprotect(const void *start, \ 252 unsigned long len, int prot); } 253126 STD { int linux_sys_sigprocmask(int how, \ 254 const linux_old_sigset_t *set, \ 255 linux_old_sigset_t *oset); } 256127 UNIMPL create_module 257128 UNIMPL init_module 258129 UNIMPL delete_module 259130 UNIMPL get_kernel_syms 260131 UNIMPL quotactl 261132 STD { int linux_sys_getpgid(int pid); } 262133 NOARGS { int sys_fchdir(int fd); } 263134 UNIMPL bdflush 264135 UNIMPL sysfs 265136 STD { int linux_sys_personality(int per); } 266137 UNIMPL afs_syscall 267138 STD { int linux_sys_setfsuid(uid_t uid); } 268139 NOARGS { int linux_sys_getfsuid(void); } 269140 STD { int linux_sys_llseek(int fd, u_int32_t ohigh, \ 270 u_int32_t olow, caddr_t res, int whence); } 271141 STD { int linux_sys_getdents(int fd, \ 272 struct linux_dirent *dent, unsigned int count); } 273142 STD { int linux_sys_new_select(int nfds, fd_set *readfds, \ 274 fd_set *writefds, fd_set *exceptfds, \ 275 struct timeval *timeout); } 276143 NOARGS { int sys_flock(int fd, int how); } 277144 STD { int linux_sys_msync(caddr_t addr, int len, int fl); } 278145 NOARGS { int sys_readv(int fd, struct iovec *iovp, \ 279 u_int iovcnt); } 280146 NOARGS { int sys_writev(int fd, struct iovec *iovp, \ 281 u_int iovcnt); } 282147 NOARGS { pid_t sys_getsid(pid_t pid); } 283148 STD { int linux_sys_fdatasync(int fd); } 284149 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); } 285150 NOARGS { int sys_mlock(caddr_t addr, size_t len); } 286151 NOARGS { int sys_munlock(caddr_t addr, size_t len); } 287152 NOARGS { int sys_mlockall(int flags); } 288153 NOARGS { int sys_munlockall(void); } 289154 STD { int linux_sys_sched_setparam(pid_t pid, \ 290 const struct linux_sched_param *sp); } 291155 STD { int linux_sys_sched_getparam(pid_t pid, \ 292 struct linux_sched_param *sp); } 293156 STD { int linux_sys_sched_setscheduler(pid_t pid, \ 294 int policy, const struct linux_sched_param *sp); } 295157 STD { int linux_sys_sched_getscheduler(pid_t pid); } 296158 STD { int linux_sys_sched_yield(void); } 297159 STD { int linux_sys_sched_get_priority_max(int policy); } 298160 STD { int linux_sys_sched_get_priority_min(int policy); } 299161 UNIMPL sched_rr_get_interval 300162 NOARGS { int sys_nanosleep(const struct timespec *rqtp, \ 301 struct timespec *rmtp); } 302163 STD { void *linux_sys_mremap(void *old_address, \ 303 size_t old_size, size_t new_size, u_long flags); } 304164 STD { int linux_sys_setresuid(uid_t ruid, uid_t euid, \ 305 uid_t suid); } 306165 STD { int linux_sys_getresuid(uid_t *ruid, uid_t *euid, \ 307 uid_t *suid); } 308166 UNIMPL query_module 309167 NOARGS { int sys_poll(struct pollfd *fds, u_int nfds, \ 310 int timeout); } 311168 UNIMPL nfsservctl 312169 STD { int linux_sys_setresgid(gid_t rgid, gid_t egid, \ 313 gid_t sgid); } 314170 STD { int linux_sys_getresgid(gid_t *rgid, gid_t *egid, \ 315 gid_t *sgid); } 316171 UNIMPL prctl 317172 STD { int linux_sys_rt_sigreturn( \ 318 struct linux_rt_sigframe *sfp); } 319173 STD { int linux_sys_rt_sigaction(int signum, \ 320 const struct linux_sigaction *nsa, \ 321 struct linux_sigaction *osa, \ 322 size_t sigsetsize); } 323174 STD { int linux_sys_rt_sigprocmask(int how, \ 324 const linux_sigset_t *set, \ 325 linux_sigset_t *oset, \ 326 size_t sigsetsize); } 327175 STD { int linux_sys_rt_sigpending( \ 328 linux_sigset_t *set, \ 329 size_t sigsetsize); } 330176 UNIMPL rt_sigtimedwait 331; XXX XAX int here? sigset_t here? siginfo_t 332177 STD { int linux_sys_rt_queueinfo(int pid, int signum, \ 333 void *uinfo); } 334178 STD { int linux_sys_rt_sigsuspend(linux_sigset_t *unewset, \ 335 size_t sigsetsize); } 336179 STD { int linux_sys_pread(int fd, char *buf, \ 337 size_t nbyte, linux_off_t offset); } 338180 STD { int linux_sys_pwrite(int fd, char *buf, \ 339 size_t nbyte, linux_off_t offset); } 340181 STD { int linux_sys_chown(const char *path, \ 341 int uid, int gid); } 342182 NOARGS { int sys___getcwd(char *bufp, size_t length); } 343183 UNIMPL capget 344184 UNIMPL capset 345185 STD { int linux_sys_sigaltstack( \ 346 const struct linux_sigaltstack *ss, \ 347 struct linux_sigaltstack *oss); } 348186 UNIMPL sendfile 349187 UNIMPL getpmsg 350188 UNIMPL putpmsg 351189 NOARGS { int sys___vfork14(void); } 352190 STD { int linux_sys_ugetrlimit(int which, \ 353 struct rlimit *rlp); } 354191 UNIMPL /* unused */ 355192 UNIMPL mmap2 356193 STD { int linux_sys_truncate64(const char *path, \ 357 off_t length); } 358194 NOARGS linux_ftruncate64 { int sys_ftruncate(int fd, \ 359 off_t length); } 360195 STD { int linux_sys_stat64(const char *path, \ 361 struct linux_stat64 *sp); } 362196 STD { int linux_sys_lstat64(const char *path, \ 363 struct linux_stat64 *sp); } 364197 STD { int linux_sys_fstat64(int fd, \ 365 struct linux_stat64 *sp); } 366198 UNIMPL sys_pciconfig_read 367199 UNIMPL sys_pciconfig_write 368200 UNIMPL sys_pciconfig_iobase 369201 UNIMPL /* Unused (MacOnLinux project) */ 370202 STD { int linux_sys_getdents64(int fd, \ 371 struct linux_dirent64 *dent, unsigned int count); } 372203 UNIMPL pivot_root 373204 STD { int linux_sys_fcntl64(int fd, int cmd, void *arg); } 374205 UNIMPL madvise 375206 UNIMPL mincore 376