syscalls.master revision 1.40
1 $NetBSD: syscalls.master,v 1.40 2009/01/13 22:27:43 pooka 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#include <sys/param.h> 66#include <sys/poll.h> 67#include <sys/systm.h> 68#include <sys/signal.h> 69#include <sys/mount.h> 70#include <sys/syscallargs.h> 71 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> 77 78#include <compat/linux/linux_syscallargs.h> 79 80%% 81 820 NOARGS { int|linux_sys||nosys(void); } syscall 831 NOARGS { int|sys||exit(int rval); } 842 NOARGS { int|sys||fork(void); } 853 NOARGS { int|sys||read(int fd, char *buf, u_int nbyte); } 864 NOARGS { int|sys||write(int fd, char *buf, u_int nbyte); } 875 STD { int|linux_sys||open(const char *path, int flags, \ 88 int mode); } 896 NOARGS { int|sys||close(int fd); } 907 STD { int|linux_sys||waitpid(int pid, int *status, \ 91 int options);} 928 STD { int|linux_sys||creat(const char *path, int mode); } 939 NOARGS { int|sys||link(const char *path, const char *link); } 9410 STD { int|linux_sys||unlink(const char *path); } 9511 NOARGS { int|sys||execve(const char *path, char **argp, \ 96 char **envp); } 9712 NOARGS { int|sys||chdir(const char *path); } 9813 STD { int|linux_sys||time(linux_time_t *t); } 9914 STD { int|linux_sys||mknod(const char *path, int mode, \ 100 int dev); } 10115 NOARGS { int|sys||chmod(const char *path, int mode); } 10216 NOARGS { int|sys||__posix_lchown(const char *path, int uid, \ 103 int gid); } 10417 OBSOL break 10518 OBSOL ostat 10619 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \ 107 int whence); } 10820 NOARGS { pid_t|sys||getpid(void); } 10921 UNIMPL mount 11022 OBSOL umount 11123 NOARGS { int|sys||setuid(uid_t uid); } 11224 NOARGS { uid_t|sys||getuid(void); } 11325 STD { int|linux_sys||stime(linux_time_t *t); } 11426 STD { int|linux_sys||ptrace(int request, int pid, \ 115 int addr, int data); } 11627 STD { int|linux_sys||alarm(unsigned int secs); } 11728 OBSOL ofstat 11829 STD { int|linux_sys||pause(void); } 11930 STD { int|linux_sys||utime(const char *path, \ 120 struct linux_utimbuf *times); } 12131 OBSOL stty 12232 OBSOL gtty 12333 NOARGS { int|sys||access(const char *path, int flags); } 12434 STD { int|linux_sys||nice(int incr); } 12535 OBSOL ftime 12636 NOARGS { int|sys||sync(void); } 12737 STD { int|linux_sys||kill(int pid, int signum); } 12838 NOARGS { int|sys||__posix_rename(const char *from, \ 129 const char *to); } 13039 NOARGS { int|sys||mkdir(const char *path, int mode); } 13140 NOARGS { int|sys||rmdir(const char *path); } 13241 NOARGS { int|sys||dup(u_int fd); } 13342 STD { int|linux_sys||pipe(int *pfds); } 13443 STD { int|linux_sys||times(struct times *tms); } 13544 OBSOL prof 13645 STD { int|linux_sys||brk(char *nsize); } 13746 NOARGS { int|sys||setgid(gid_t gid); } 13847 NOARGS { gid_t|sys||getgid(void); } 13948 STD { int|linux_sys||signal(int signum, \ 140 linux_handler_t handler); } 14149 NOARGS { uid_t|sys||geteuid(void); } 14250 NOARGS { gid_t|sys||getegid(void); } 14351 NOARGS { int|sys||acct(char *path); } 14452 UNIMPL umount 14553 OBSOL lock 14654 STD { int|linux_sys||ioctl(int fd, u_long com, \ 147 void *data); } 14855 STD { int|linux_sys||fcntl(int fd, int cmd, void *arg); } 14956 OBSOL mpx 15057 NOARGS { int|sys||setpgid(int pid, int pgid); } 15158 OBSOL ulimit 15259 STD { int|linux_sys||olduname(struct linux_old_utsname \ 153 *up); } 15460 NOARGS { int|sys||umask(int newmask); } 15561 NOARGS { int|sys||chroot(char *path); } 15662 UNIMPL ustat 15763 NOARGS { int|sys||dup2(u_int from, u_int to); } 15864 NOARGS { pid_t|sys||getppid(void); } 15965 NOARGS { int|sys||getpgrp(void); } 16066 NOARGS { int|sys||setsid(void); } 16167 STD { int|linux_sys||sigaction(int signum, \ 162 const struct linux_old_sigaction *nsa, \ 163 struct linux_old_sigaction *osa); } 16468 STD { int|linux_sys||siggetmask(void); } 16569 STD { int|linux_sys||sigsetmask(linux_old_sigset_t mask); } 16670 NOARGS { int|sys||setreuid(uid_t ruid, uid_t euid); } 16771 NOARGS { int|sys||setregid(gid_t rgid, gid_t egid); } 16872 STD { int|linux_sys||sigsuspend(void *restart, \ 169 int oldmask, int mask); } 17073 STD { int|linux_sys||sigpending(linux_old_sigset_t *set); } 17174 NOARGS { int|compat_43_sys||sethostname(char *hostname, \ 172 u_int len);} 17375 STD { int|linux_sys||setrlimit(u_int which, \ 174 struct orlimit *rlp); } 17576 STD { int|linux_sys||getrlimit(u_int which, \ 176 struct orlimit *rlp); } 17777 NOARGS { int|sys||getrusage(int who, struct rusage *rusage); } 17878 STD { int|linux_sys||gettimeofday(struct timeval *tp, \ 179 struct timezone *tzp); } 18079 STD { int|linux_sys||settimeofday(struct timeval *tp, \ 181 struct timezone *tzp); } 18280 NOARGS { int|sys||getgroups(u_int gidsetsize, gid_t *gidset); } 18381 NOARGS { int|sys||setgroups(u_int gidsetsize, gid_t *gidset); } 18482 STD { int|linux_sys||select(int nfds, fd_set* readfds, \ 185 fd_set* writefds, fd_set* exceptfds, \ 186 struct timeval *timeout); } 18783 NOARGS { int|sys||symlink(const char *path, const char *to); } 18884 NOARGS { int|compat_43_sys||lstat(const char *path, \ 189 struct stat43 *up); } oolstat 19085 NOARGS { int|sys||readlink(const char *name, char *buf, \ 191 int count); } 192#ifdef EXEC_AOUT 19386 STD { int|linux_sys||uselib(const char *path); } 194#else 19586 UNIMPL sys_uselib 196#endif 19787 STD { int|linux_sys||swapon(char *name); } 19888 STD { int|linux_sys||reboot(int magic1, int magic2, \ 199 int cmd, void *arg); } 20089 STD { int|linux_sys||readdir(int fd, void *dent, \ 201 unsigned int count); } 20290 NOARGS { int|linux_sys||mmap(unsigned long addr, size_t len, \ 203 int prot, int flags, int fd, linux_off_t offset); } 20491 NOARGS { int|sys||munmap(void *addr, int len); } 20592 NOARGS { int|compat_43_sys||truncate(const char *path, \ 206 long length); } 20793 NOARGS { int|compat_43_sys||ftruncate(int fd, long length); } 20894 NOARGS { int|sys||fchmod(int fd, int mode); } 20995 NOARGS { int|sys||__posix_fchown(int fd, int uid, int gid); } 21096 STD { int|linux_sys||getpriority(int which, int who); } 21197 NOARGS { int|sys||setpriority(int which, int who, int prio); } 21298 NOARGS { int|sys||profil(void *samples, u_int size, \ 213 u_int offset, u_int scale); } 21499 STD { int|linux_sys||statfs(const char *path, \ 215 struct linux_statfs *sp); } 216100 STD { int|linux_sys||fstatfs(int fd, \ 217 struct linux_statfs *sp); } 218101 STD { int|linux_sys||ioperm(unsigned int lo, \ 219 unsigned int hi, int val); } 220102 STD { int|linux_sys||socketcall(int what, void *args); } 221103 UNIMPL syslog 222104 NOARGS { int|sys||setitimer(u_int which, \ 223 struct itimerval *itv, struct itimerval *oitv); } 224105 NOARGS { int|sys||getitimer(u_int which, \ 225 struct itimerval *itv); } 226106 STD { int|linux_sys||stat(const char *path, \ 227 struct linux_stat *sp); } 228107 STD { int|linux_sys||lstat(const char *path, \ 229 struct linux_stat *sp); } 230108 STD { int|linux_sys||fstat(int fd, struct linux_stat *sp); } 231109 STD { int|linux_sys||uname(struct linux_utsname *up); } 232110 UNIMPL iopl 233111 UNIMPL vhangup 234112 UNIMPL idle 235113 UNIMPL vm86old 236114 STD { int|linux_sys||wait4(int pid, int *status, \ 237 int options, struct rusage *rusage); } 238115 STD { int|linux_sys||swapoff(const char *path); } 239116 STD { int|linux_sys||sysinfo(struct linux_sysinfo *arg); } 240117 STD { int|linux_sys||ipc(int what, int a1, int a2, int a3, \ 241 void *ptr); } 242118 NOARGS { int|sys||fsync(int fd); } 243119 STD { int|linux_sys||sigreturn(struct linux_sigcontext *scp); } 244120 STD { int|linux_sys||clone(int flags, void *stack); } 245121 STD { int|linux_sys||setdomainname(char *domainname, \ 246 int len); } 247122 STD { int|linux_sys||new_uname(struct linux_utsname *up); } 248123 UNIMPL modify_ldt 249124 UNIMPL adjtimex 250125 STD { int|linux_sys||mprotect(const void *start, \ 251 unsigned long len, int prot); } 252126 STD { int|linux_sys||sigprocmask(int how, \ 253 const linux_old_sigset_t *set, \ 254 linux_old_sigset_t *oset); } 255127 UNIMPL create_module 256128 UNIMPL init_module 257129 UNIMPL delete_module 258130 UNIMPL get_kernel_syms 259131 UNIMPL quotactl 260132 NOARGS { pid_t|sys||getpgid(pid_t pid); } 261133 NOARGS { int|sys||fchdir(int fd); } 262134 UNIMPL bdflush 263135 UNIMPL sysfs 264136 STD { int|linux_sys||personality(int per); } 265137 UNIMPL afs_syscall 266138 STD { int|linux_sys||setfsuid(uid_t uid); } 267139 STD { int|linux_sys||setfsgid(gid_t gid); } 268140 STD { int|linux_sys||llseek(int fd, u_int32_t ohigh, \ 269 u_int32_t olow, void *res, int whence); } 270141 STD { int|linux_sys||getdents(int fd, \ 271 struct linux_dirent *dent, unsigned int count); } 272142 STD { int|linux_sys||new_select(int nfds, fd_set *readfds, \ 273 fd_set *writefds, fd_set *exceptfds, \ 274 struct timeval *timeout); } 275143 NOARGS { int|sys||flock(int fd, int how); } 276144 NOARGS { int|sys|13|msync(void *addr, size_t len, int flags); } 277145 NOARGS { int|sys||readv(int fd, struct iovec *iovp, \ 278 u_int iovcnt); } 279146 NOARGS { int|sys||writev(int fd, struct iovec *iovp, \ 280 u_int iovcnt); } 281147 NOARGS { pid_t|sys||getsid(pid_t pid); } 282148 STD { int|linux_sys||fdatasync(int fd); } 283149 STD { int|linux_sys||__sysctl(struct linux___sysctl *lsp); } 284150 NOARGS { int|sys||mlock(void *addr, size_t len); } 285151 NOARGS { int|sys||munlock(void *addr, size_t len); } 286152 NOARGS { int|sys||mlockall(int flags); } 287153 NOARGS { int|sys||munlockall(void); } 288154 STD { int|linux_sys||sched_setparam(pid_t pid, \ 289 const struct linux_sched_param *sp); } 290155 STD { int|linux_sys||sched_getparam(pid_t pid, \ 291 struct linux_sched_param *sp); } 292156 STD { int|linux_sys||sched_setscheduler(pid_t pid, \ 293 int policy, const struct linux_sched_param *sp); } 294157 STD { int|linux_sys||sched_getscheduler(pid_t pid); } 295158 STD { int|linux_sys||sched_yield(void); } 296159 STD { int|linux_sys||sched_get_priority_max(int policy); } 297160 STD { int|linux_sys||sched_get_priority_min(int policy); } 298161 UNIMPL sched_rr_get_interval 299162 STD { int|linux_sys||nanosleep( \ 300 const struct linux_timespec *rqtp, \ 301 struct linux_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 NOARGS { int|sys||__posix_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|14|vfork(void); } 352190 STD { int|linux_sys||ugetrlimit(int which, \ 353 struct rlimit *rlp); } 354191 UNIMPL /* unused */ 355#define linux_sys_mmap2_args linux_sys_mmap_args 356192 NOARGS { linux_off_t|linux_sys||mmap2(unsigned long addr, \ 357 size_t len, int prot, int flags, int fd, \ 358 linux_off_t offset); } 359193 STD { int|linux_sys||truncate64(const char *path, \ 360 off_t length); } 361194 STD { int|linux_sys||ftruncate64(unsigned int fd, \ 362 off_t length); } 363195 STD { int|linux_sys||stat64(const char *path, \ 364 struct linux_stat64 *sp); } 365196 STD { int|linux_sys||lstat64(const char *path, \ 366 struct linux_stat64 *sp); } 367197 STD { int|linux_sys||fstat64(int fd, \ 368 struct linux_stat64 *sp); } 369198 UNIMPL sys_pciconfig_read 370199 UNIMPL sys_pciconfig_write 371200 UNIMPL sys_pciconfig_iobase 372201 UNIMPL /* Unused (MacOnLinux project) */ 373202 STD { int|linux_sys||getdents64(int fd, \ 374 struct linux_dirent64 *dent, unsigned int count); } 375203 UNIMPL pivot_root 376204 STD { int|linux_sys||fcntl64(int fd, int cmd, void *arg); } 377205 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 378206 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 379207 UNIMPL gettid 380208 UNIMPL tkill 381209 STD { int|linux_sys||setxattr(char *path, char *name, \ 382 void *value, size_t size, int flags); } 383210 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 384 void *value, size_t size, int flags); } 385211 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 386 void *value, size_t size, int flags); } 387212 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 388 void *value, size_t size); } 389213 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 390 void *value, size_t size); } 391214 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 392 void *value, size_t size); } 393215 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 394 size_t size); } 395216 STD { ssize_t|linux_sys||llistxattr(char *path, char *list, \ 396 size_t size); } 397217 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \ 398 size_t size); } 399218 STD { int|linux_sys||removexattr(char *path, char *name); } 400219 STD { int|linux_sys||lremovexattr(char *path, char *name); } 401220 STD { int|linux_sys||fremovexattr(int fd, char *name); } 402221 UNIMPL futex 403222 UNIMPL sched_setaffinity 404223 UNIMPL sched_getaffinity 405224 UNIMPL /* unused */ 406225 UNIMPL tuxcall 407226 UNIMPL sendfile64 408227 UNIMPL io_setup 409228 UNIMPL io_destroy 410229 UNIMPL io_getevents 411230 UNIMPL io_submit 412231 UNIMPL io_cancel 413232 UNIMPL set_tid_address 414233 UNIMPL fadvise64 415234 STD { int|linux_sys||exit_group(int error_code); } 416235 UNIMPL lookup_dcookie 417236 UNIMPL epoll_create 418237 UNIMPL epoll_ctl 419238 UNIMPL epoll_wait 420239 UNIMPL remap_file_pages 421240 UNIMPL timer_create 422241 UNIMPL timer_settime 423242 UNIMPL timer_gettime 424243 UNIMPL timer_getoverrun 425244 UNIMPL timer_delete 426245 STD { int|linux_sys||clock_settime(clockid_t which, \ 427 struct linux_timespec *tp); } 428246 STD { int|linux_sys||clock_gettime(clockid_t which, \ 429 struct linux_timespec *tp); } 430247 STD { int|linux_sys||clock_getres(clockid_t which, \ 431 struct linux_timespec *tp); } 432248 STD { int|linux_sys||clock_nanosleep(clockid_t which, \ 433 int flags, struct linux_timespec *rqtp, \ 434 struct linux_timespec *rmtp); } 435249 UNIMPL swapcontext 436250 UNIMPL tgkill 437251 UNIMPL utimes 438252 STD { int|linux_sys||statfs64(const char *path, \ 439 size_t sz, struct linux_statfs64 *sp); } 440253 STD { int|linux_sys||fstatfs64(int fd, \ 441 size_t sz, struct linux_statfs64 *sp); } 442254 UNIMPL fadvise64_64 443255 UNIMPL rtas 444256 UNIMPL /* reserved for sys_debug_setcontext */ 445257 UNIMPL /* reserved for vserver */ 446258 UNIMPL /* reserved for new sys_remap_file_pages */ 447259 UNIMPL /* reserved for new sys_mbind */ 448260 UNIMPL /* reserved for new sys_get_mempolicy */ 449261 UNIMPL /* reserved for new sys_set_mempolicy */ 450262 UNIMPL mq_open 451263 UNIMPL mq_unlink 452264 UNIMPL mq_timedsend 453265 UNIMPL mq_timedreceive 454266 UNIMPL mq_notify 455267 UNIMPL mq_getsetattr 456268 UNIMPL kexec_load 457