1 $NetBSD: syscalls.master,v 1.37 2009/11/24 10:42:44 njoly Exp $ 2 3; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 4 5; Derived from NetBSD's sys/compat/linux/arch/powerpc/syscalls.master 6; from Linux's arch/mips/kernel/syscalls.h 7 8; NetBSD mips COMPAT_LINUX system call name/number "master" file. 9; (See syscalls.conf to see what it is processed into.) 10; 11; Expect problems with 12; 48 signal: undefined in Linux??? 13; 86 uselib: needs a.out 14; 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. 19; 20; types: 21; STD always included 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. 28; 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). 33; 34; The type-dependent arguments are as follows: 35; For STD, NODEF, NOARGS, and compat syscalls: 36; { pseudo-proto } [alias] 37; For other syscalls: 38; [comment] 39; 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. 42 43#include <sys/param.h> 44#include <sys/poll.h> 45#include <sys/systm.h> 46#include <sys/signal.h> 47#include <sys/mount.h> 48#include <sys/syscallargs.h> 49 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> 56 57#include <compat/linux/linux_syscallargs.h> 58 590 NOARGS { int|linux_sys||nosys(void); } syscall 601 NOARGS { int|sys||exit(int rval); } 612 NOARGS { int|sys||fork(void); } 623 NOARGS { int|sys||read(int fd, char *buf, u_int nbyte); } 634 NOARGS { int|sys||write(int fd, char *buf, u_int nbyte); } 645 STD { int|linux_sys||open(const char *path, int flags, \ 65 int mode); } 666 NOARGS { int|sys||close(int fd); } 677 STD { int|linux_sys||waitpid(int pid, int *status, \ 68 int options);} 698 STD { int|linux_sys||creat(const char *path, int mode); } 709 NOARGS { int|sys||link(const char *path, const char *link); } 7110 STD { int|linux_sys||unlink(const char *path); } 7211 NOARGS { int|sys||execve(const char *path, char **argp, \ 73 char **envp); } 7412 NOARGS { int|sys||chdir(const char *path); } 7513 STD { int|linux_sys||time(linux_time_t *t); } 7614 STD { int|linux_sys||mknod(const char *path, int mode, \ 77 int dev); } 7815 NOARGS { int|sys||chmod(const char *path, int mode); } 7916 NOARGS { int|sys||__posix_lchown(const char *path, int uid, \ 80 int gid); } 8117 UNIMPL 8218 OBSOL ostat 8319 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \ 84 int whence); } 8520 NOARGS { pid_t|sys||getpid(void); } 8621 UNIMPL mount 8722 OBSOL umount 8823 NOARGS { int|sys||setuid(uid_t uid); } 8924 NOARGS { uid_t|sys||getuid(void); } 9025 STD { int|linux_sys||stime(linux_time_t *t); } 9126 STD { int|linux_sys||ptrace(int request, int pid, \ 92 int addr, int data); } 9327 STD { int|linux_sys||alarm(unsigned int secs); } 9428 OBSOL ofstat 9529 STD { int|linux_sys||pause(void); } 9630 STD { int|linux_sys||utime(const char *path, \ 97 struct linux_utimbuf *times); } 9831 UNIMPL 9932 UNIMPL 10033 NOARGS { int|sys||access(const char *path, int flags); } 10134 STD { int|linux_sys||nice(int incr); } 10235 UNIMPL 10336 NOARGS { int|sys||sync(void); } 10437 STD { int|linux_sys||kill(int pid, int signum); } 10538 NOARGS { int|sys||__posix_rename(const char *from, \ 106 const char *to); } 10739 NOARGS { int|sys||mkdir(const char *path, int mode); } 10840 NOARGS { int|sys||rmdir(const char *path); } 10941 NOARGS { int|sys||dup(u_int fd); } 11042 STD { int|linux_sys||pipe(int *pfds); } 11143 STD { int|linux_sys||times(struct times *tms); } 11244 UNIMPL 11345 STD { int|linux_sys||brk(char *nsize); } 11446 NOARGS { int|sys||setgid(gid_t gid); } 11547 NOARGS { gid_t|sys||getgid(void); } 11648 STD { int|linux_sys||signal(int signum, \ 117 linux___sighandler_t handler); } 11849 NOARGS { uid_t|sys||geteuid(void); } 11950 NOARGS { gid_t|sys||getegid(void); } 12051 NOARGS { int|sys||acct(char *path); } 12152 UNIMPL umount 12253 UNIMPL 12354 STD { int|linux_sys||ioctl(int fd, u_long com, \ 124 void *data); } 12555 STD { int|linux_sys||fcntl(int fd, int cmd, void *arg); } 12656 OBSOL mpx 12757 NOARGS { int|sys||setpgid(int pid, int pgid); } 12858 UNIMPL 12959 STD { int|linux_sys||olduname(struct linux_old_utsname \ 130 *up); } 13160 NOARGS { int|sys||umask(int newmask); } 13261 NOARGS { int|sys||chroot(char *path); } 13362 UNIMPL ustat 13463 NOARGS { int|sys||dup2(u_int from, u_int to); } 13564 NOARGS { pid_t|sys||getppid(void); } 13665 NOARGS { int|sys||getpgrp(void); } 13766 NOARGS { int|sys||setsid(void); } 13867 STD { int|linux_sys||sigaction(int signum, \ 139 const struct linux_old_sigaction *nsa, \ 140 struct linux_old_sigaction *osa); } 14168 STD { int|linux_sys||siggetmask(void); } 14269 STD { int|linux_sys||sigsetmask(linux_old_sigset_t mask); } 14370 NOARGS { int|sys||setreuid(uid_t ruid, uid_t euid); } 14471 NOARGS { int|sys||setregid(gid_t rgid, gid_t egid); } 14572 STD { int|linux_sys||sigsuspend(void *restart, \ 146 int oldmask, int mask); } 14773 STD { int|linux_sys||sigpending(linux_old_sigset_t *set); } 14874 NOARGS { int|compat_43_sys||sethostname(char *hostname, \ 149 u_int len);} 15075 STD { int|linux_sys||setrlimit(u_int which, \ 151 struct orlimit *rlp); } 15276 STD { int|linux_sys||getrlimit(u_int which, \ 153 struct orlimit *rlp); } 15477 NOARGS { int|compat_50_sys||getrusage(int who, \ 155 struct rusage50 *rusage); } 15678 STD { int|linux_sys||gettimeofday(struct timeval50 *tp, \ 157 struct timezone *tzp); } 15879 STD { int|linux_sys||settimeofday(struct timeval50 *tp, \ 159 struct timezone *tzp); } 16080 NOARGS { int|sys||getgroups(u_int gidsetsize, gid_t *gidset); } 16181 NOARGS { int|sys||setgroups(u_int gidsetsize, gid_t *gidset); } 16282 UNIMPL old_select 16383 NOARGS { int|sys||symlink(const char *path, const char *to); } 16484 NOARGS { int|compat_43_sys||lstat(const char *path, \ 165 struct stat43 *up); } oolstat 16685 NOARGS { int|sys||readlink(const char *name, char *buf, \ 167 int count); } 16886 UNIMPL uselib 169;86 STD { int|linux_sys||uselib(const char *path); } 17087 STD { int|linux_sys||swapon(char *name); } 17188 STD { int|linux_sys||reboot(int magic1, int magic2, \ 172 int cmd, void *arg); } 17389 STD { int|linux_sys||readdir(int fd, void *dent, \ 174 unsigned int count); } 17590 NOARGS { int|linux_sys||mmap(unsigned long addr, size_t len, \ 176 int prot, int flags, int fd, linux_off_t offset); } 17791 NOARGS { int|sys||munmap(void *addr, int len); } 17892 NOARGS { int|compat_43_sys||truncate(const char *path, \ 179 long length); } 18093 NOARGS { int|compat_43_sys||ftruncate(int fd, long length); } 18194 NOARGS { int|sys||fchmod(int fd, int mode); } 18295 NOARGS { int|sys||__posix_fchown(int fd, int uid, int gid); } 18396 STD { int|linux_sys||getpriority(int which, int who); } 18497 NOARGS { int|sys||setpriority(int which, int who, int prio); } 18598 UNIMPL 18699 STD { int|linux_sys||statfs(const char *path, \ 187 struct linux_statfs *sp); } 188100 STD { int|linux_sys||fstatfs(int fd, \ 189 struct linux_statfs *sp); } 190101 STD { int|linux_sys||ioperm(unsigned int lo, \ 191 unsigned int hi, int val); } 192102 STD { int|linux_sys||socketcall(int what, void *args); } 193103 UNIMPL syslog 194104 NOARGS { int|compat_50_sys||setitimer(u_int which, \ 195 struct itimerval50 *itv, \ 196 struct itimerval50 *oitv); } 197105 NOARGS { int|compat_50_sys||getitimer(u_int which, \ 198 struct itimerval50 *itv); } 199106 STD { int|linux_sys||stat(const char *path, \ 200 struct linux_stat *sp); } 201107 STD { int|linux_sys||lstat(const char *path, \ 202 struct linux_stat *sp); } 203108 STD { int|linux_sys||fstat(int fd, struct linux_stat *sp); } 204109 STD { int|linux_sys||uname(struct linux_utsname *up); } 205110 UNIMPL iopl 206111 UNIMPL vhangup 207112 UNIMPL idle 208113 UNIMPL vm86old 209114 STD { int|linux_sys||wait4(int pid, int *status, \ 210 int options, struct rusage50 *rusage); } 211115 STD { int|linux_sys||swapoff(const char *path); } 212116 STD { int|linux_sys||sysinfo(struct linux_sysinfo *arg); } 213117 STD { int|linux_sys||ipc(int what, int a1, int a2, int a3, \ 214 void *ptr); } 215118 NOARGS { int|sys||fsync(int fd); } 216119 STD { int|linux_sys||sigreturn(struct linux_sigframe *sf); } 217120 STD { int|linux_sys||clone(int flags, void *stack); } 218121 STD { int|linux_sys||setdomainname(char *domainname, \ 219 int len); } 220122 STD { int|linux_sys||new_uname(struct linux_utsname *up); } 221123 UNIMPL modify_ldt 222124 UNIMPL adjtimex 223125 STD { int|linux_sys||mprotect(const void *start, \ 224 unsigned long len, int prot); } 225126 STD { int|linux_sys||sigprocmask(int how, \ 226 const linux_old_sigset_t *set, \ 227 linux_old_sigset_t *oset); } 228127 UNIMPL create_module 229128 UNIMPL init_module 230129 UNIMPL delete_module 231130 UNIMPL get_kernel_syms 232131 UNIMPL quotactl 233132 NOARGS { pid_t|sys||getpgid(pid_t pid); } 234133 NOARGS { int|sys||fchdir(int fd); } 235134 UNIMPL bdflush 236135 UNIMPL sysfs 237136 STD { int|linux_sys||personality(unsigned long per); } 238137 UNIMPL afs_syscall 239138 STD { int|linux_sys||setfsuid(uid_t uid); } 240139 STD { int|linux_sys||setfsgid(gid_t gid); } 241140 STD { int|linux_sys||llseek(int fd, u_int32_t ohigh, \ 242 u_int32_t olow, void *res, int whence); } 243141 STD { int|linux_sys||getdents(int fd, \ 244 struct linux_dirent *dent, unsigned int count); } 245142 STD { int|linux_sys||select(int nfds, fd_set *readfds, \ 246 fd_set *writefds, fd_set *exceptfds, \ 247 struct timeval50 *timeout); } 248143 NOARGS { int|sys||flock(int fd, int how); } 249144 NOARGS { int|sys|13|msync(void *addr, size_t len, int flags); } 250145 NOARGS { int|sys||readv(int fd, struct iovec *iovp, \ 251 u_int iovcnt); } 252146 NOARGS { int|sys||writev(int fd, struct iovec *iovp, \ 253 u_int iovcnt); } 254147 STD { int|linux_sys||cacheflush(void *addr, \ 255 int bytes, int cache); } 256148 UNIMPL cachectl 257149 STD { int|linux_sys||sysmips(int cmd, int arg1, \ 258 int arg2, int arg3); } 259150 UNIMPL 260151 NOARGS { pid_t|sys||getsid(pid_t pid); } 261152 STD { int|linux_sys||fdatasync(int fd); } 262153 STD { int|linux_sys||__sysctl(struct linux___sysctl *lsp); } 263154 NOARGS { int|sys||mlock(void *addr, size_t len); } 264155 NOARGS { int|sys||munlock(void *addr, size_t len); } 265156 NOARGS { int|sys||mlockall(int flags); } 266157 NOARGS { int|sys||munlockall(void); } 267158 STD { int|linux_sys||sched_setparam(pid_t pid, \ 268 const struct linux_sched_param *sp); } 269159 STD { int|linux_sys||sched_getparam(pid_t pid, \ 270 struct linux_sched_param *sp); } 271160 STD { int|linux_sys||sched_setscheduler(pid_t pid, \ 272 int policy, const struct linux_sched_param *sp); } 273161 STD { int|linux_sys||sched_getscheduler(pid_t pid); } 274162 STD { int|linux_sys||sched_yield(void); } 275163 STD { int|linux_sys||sched_get_priority_max(int policy); } 276164 STD { int|linux_sys||sched_get_priority_min(int policy); } 277165 UNIMPL sched_rr_get_interval 278166 STD { int|linux_sys||nanosleep( \ 279 const struct linux_timespec *rqtp, \ 280 struct linux_timespec *rmtp); } 281167 STD { void *|linux_sys||mremap(void *old_address, \ 282 size_t old_size, size_t new_size, u_long flags); } 283168 NOARGS { int|linux_sys||accept(int s, \ 284 struct osockaddr *name, int *anamelen); } 285169 NOARGS { int|linux_sys||bind(int s, \ 286 const struct osockaddr *name, int namelen); } 287170 NOARGS { int|linux_sys||connect(int s, \ 288 const struct sockaddr *name, int namelen); } 289171 NOARGS { int|linux_sys||getpeername(int fdes, void *asa, \ 290 int *alen); } 291172 NOARGS { int|linux_sys||getsockname(int fdes, void *asa, \ 292 int *alen); } 293173 NOARGS { int|linux_sys||getsockopt(int s, int level, \ 294 int optname, void *optval, int *optlen); } 295174 NOARGS { int|sys||listen(int s, int backlog); } 296175 NOARGS { int|linux_sys||recv(int s, void *buf, int len, \ 297 int flags); } 298176 NOARGS { int|linux_sys||recvfrom(int s, void *buf, int len, \ 299 int flags, struct osockaddr *from, \ 300 int *fromlenaddr); } 301177 NOARGS { int|linux_sys||recvmsg(int s, \ 302 struct linux_msghdr *msg, u_int flags); } 303178 NOARGS { int|linux_sys||send(int s, void *buf, int len, \ 304 int flags); } 305179 NOARGS { int|linux_sys||sendmsg(int s, \ 306 struct linux_msghdr *msg, u_int flags); } 307180 NOARGS { int|linux_sys||sendto(int s, void *msg, \ 308 int len, int flags, struct osockaddr *to, \ 309 int tolen); } 310181 NOARGS { int|linux_sys||setsockopt(int s, int level, \ 311 int optname, void *optval, int optlen); } 312182 UNIMPL shutdown 313183 NOARGS { int|linux_sys||socket(int domain, int type, \ 314 int protocol); } 315184 NOARGS { int|linux_sys||socketpair(int domain, int type, \ 316 int protocol, int *rsv); } 317185 STD { int|linux_sys||setresuid(uid_t ruid, uid_t euid, \ 318 uid_t suid); } 319186 STD { int|linux_sys||getresuid(uid_t *ruid, uid_t *euid, \ 320 uid_t *suid); } 321187 UNIMPL query_module 322188 NOARGS { int|sys||poll(struct pollfd *fds, u_int nfds, \ 323 int timeout); } 324189 UNIMPL nfsservctl 325190 STD { int|linux_sys||setresgid(gid_t rgid, gid_t egid, \ 326 gid_t sgid); } 327191 STD { int|linux_sys||getresgid(gid_t *rgid, gid_t *egid, \ 328 gid_t *sgid); } 329192 UNIMPL prctl 330193 STD { int|linux_sys||rt_sigreturn( \ 331 struct linux_pt_regs regs); } 332194 STD { int|linux_sys||rt_sigaction(int signum, \ 333 const struct linux_sigaction *nsa, \ 334 struct linux_sigaction *osa, \ 335 size_t sigsetsize); } 336195 STD { int|linux_sys||rt_sigprocmask(int how, \ 337 const linux_sigset_t *set, \ 338 linux_sigset_t *oset, \ 339 size_t sigsetsize); } 340196 STD { int|linux_sys||rt_sigpending( \ 341 linux_sigset_t *set, \ 342 size_t sigsetsize); } 343197 UNIMPL rt_sigtimedwait 344198 STD { int|linux_sys||rt_queueinfo(int pid, int signum, \ 345 linux_siginfo_t *uinfo); } 346199 STD { int|linux_sys||rt_sigsuspend(linux_sigset_t *unewset, \ 347 size_t sigsetsize); } 348200 STD { int|linux_sys||pread(int fd, char *buf, \ 349 size_t nbyte, linux_off_t offset); } 350201 STD { int|linux_sys||pwrite(int fd, char *buf, \ 351 size_t nbyte, linux_off_t offset); } 352202 NOARGS { int|sys||__posix_chown(const char *path, \ 353 int uid, int gid); } 354203 NOARGS { int|sys||__getcwd(char *bufp, size_t length); } 355204 UNIMPL capget 356205 UNIMPL capset 357206 STD { int|linux_sys||sigaltstack( \ 358 const struct linux_sigaltstack *ss, \ 359 struct linux_sigaltstack *oss); } 360207 UNIMPL sendfile 361208 UNIMPL 362209 UNIMPL 363#define linux_sys_mmap2_args linux_sys_mmap_args 364210 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); } 367211 STD { int|linux_sys||truncate64(const char *path, \ 368 off_t length); } 369212 STD { int|linux_sys||ftruncate64(unsigned int fd, \ 370 off_t length); } 371213 STD { int|linux_sys||stat64(const char *path, \ 372 struct linux_stat64 *sp); } 373214 STD { int|linux_sys||lstat64(const char *path, \ 374 struct linux_stat64 *sp); } 375215 STD { int|linux_sys||fstat64(int fd, \ 376 struct linux_stat64 *sp); } 377216 UNIMPL pivot_root 378217 NOARGS { int|sys||mincore(void *addr, size_t len, char *vec); } 379218 NOARGS { int|sys||madvise(void *addr, size_t len, int behav); } 380219 STD { int|linux_sys||getdents64(int fd, \ 381 struct linux_dirent64 *dent, unsigned int count); } 382220 STD { int|linux_sys||fcntl64(int fd, \ 383 int cmd, void *arg); } 384221 UNIMPL /* reserved */ 385222 UNIMPL gettid 386223 UNIMPL readahead 387224 STD { int|linux_sys||setxattr(char *path, char *name, \ 388 void *value, size_t size, int flags); } 389225 STD { int|linux_sys||lsetxattr(char *path, char *name, \ 390 void *value, size_t size, int flags); } 391226 STD { int|linux_sys||fsetxattr(int fd, char *name, \ 392 void *value, size_t size, int flags); } 393227 STD { ssize_t|linux_sys||getxattr(char *path, char *name, \ 394 void *value, size_t size); } 395228 STD { ssize_t|linux_sys||lgetxattr(char *path, char *name, \ 396 void *value, size_t size); } 397229 STD { ssize_t|linux_sys||fgetxattr(int fd, char *name, \ 398 void *value, size_t size); } 399230 STD { ssize_t|linux_sys||listxattr(char *path, char *list, \ 400 size_t size); } 401231 STD { ssize_t|linux_sys||llistxattr(char *path, char *list, \ 402 size_t size); } 403232 STD { ssize_t|linux_sys||flistxattr(int fd, char *list, \ 404 size_t size); } 405233 STD { int|linux_sys||removexattr(char *path, char *name); } 406234 STD { int|linux_sys||lremovexattr(char *path, char *name); } 407235 STD { int|linux_sys||fremovexattr(int fd, char *name); } 408236 UNIMPL tkill 409237 UNIMPL sendfile64 410238 UNIMPL futex 411239 UNIMPL sched_setaffinity 412240 UNIMPL sched_getaffinity 413241 UNIMPL io_setup 414242 UNIMPL io_destroy 415243 UNIMPL io_getevents 416244 UNIMPL io_submit 417245 UNIMPL io_cancel 418246 STD { int|linux_sys||exit_group(int error_code); } 419247 UNIMPL lookup_dcookie 420248 UNIMPL epoll_create 421249 UNIMPL epoll_ctl 422250 UNIMPL epoll_wait 423251 UNIMPL remap_file_pages 424252 UNIMPL set_tid_address 425253 UNIMPL restart_syscall 426254 UNIMPL fadvise64 427255 STD { int|linux_sys||statfs64(const char *path, \ 428 size_t sz, struct linux_statfs64 *sp); } 429256 STD { int|linux_sys||fstatfs64(int fd, \ 430 size_t sz, struct linux_statfs64 *sp); } 431257 UNIMPL timer_create 432258 UNIMPL timer_settime 433259 UNIMPL timer_gettime 434260 UNIMPL timer_getoverrun 435261 UNIMPL timer_delete 436262 STD { int|linux_sys||clock_settime(clockid_t which, \ 437 struct linux_timespec *tp); } 438263 STD { int|linux_sys||clock_gettime(clockid_t which, \ 439 struct linux_timespec *tp); } 440264 STD { int|linux_sys||clock_getres(clockid_t which, \ 441 struct linux_timespec *tp); } 442265 STD { int|linux_sys||clock_nanosleep(clockid_t which, \ 443 int flags, struct linux_timespec *rqtp, \ 444 struct linux_timespec *rmtp); } 445266 UNIMPL tgkill 446267 UNIMPL utimes 447268 UNIMPL mbind 448269 UNIMPL get_mempolicy 449270 UNIMPL set_mempolicy 450271 UNIMPL mq_open 451272 UNIMPL mq_unlink 452273 UNIMPL mq_timedsend 453274 UNIMPL mq_timedreceive 454275 UNIMPL mq_notify 455276 UNIMPL mq_getsetattr 456