syscalls.master revision 1.197
1 $NetBSD: syscalls.master,v 1.197 2008/04/21 00:13:46 ad Exp $ 2 3; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 4 5; NetBSD system call name/number "master" file. 6; (See syscalls.conf to see what it is processed into.) 7; 8; Fields: number type [type-dependent ...] 9; number system call number, must be in order 10; type one of STD, OBSOL, UNIMPL, IGNORED, NODEF, NOARGS, or one of 11; the compatibility options defined in syscalls.conf. 12; 13; Optional fields are specified after the type field 14; (NOTE! they must be specified in this order): 15; MPSAFE: the system call is MP-safe. 16; RUMP: the system call can be called directly from rumps 17; 18; types: 19; STD always included 20; OBSOL obsolete, not included in system 21; IGNORED syscall is a null op, but always succeeds 22; UNIMPL unimplemented, not included in system 23; EXCL implemented, but 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 "opt_nfsserver.h" 44#include "opt_ntp.h" 45#include "opt_compat_netbsd.h" 46#include "opt_sysv.h" 47#include "opt_compat_43.h" 48#include "opt_posix.h" 49 50#include "fs_lfs.h" 51#include "fs_nfs.h" 52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/signal.h> 56#include <sys/mount.h> 57#include <sys/syscallargs.h> 58 59%% 60 61; Reserved/unimplemented system calls in the range 0-150 inclusive 62; are reserved for use in future Berkeley releases. 63; Additional system calls implemented in vendor and other 64; redistributions should be placed in the reserved range at the end 65; of the current calls. 66 670 INDIR { int sys_syscall(int code, \ 68 ... register_t args[SYS_MAXSYSARGS]); } 691 STD MPSAFE { void sys_exit(int rval); } 702 STD MPSAFE { int sys_fork(void); } 713 STD MPSAFE RUMP { ssize_t sys_read(int fd, void *buf, size_t nbyte); } 724 STD MPSAFE RUMP { ssize_t sys_write(int fd, const void *buf, \ 73 size_t nbyte); } 745 STD MPSAFE RUMP { int sys_open(const char *path, \ 75 int flags, ... mode_t mode); } 766 STD MPSAFE RUMP { int sys_close(int fd); } 777 STD MPSAFE { int sys_wait4(int pid, int *status, int options, \ 78 struct rusage *rusage); } 798 COMPAT_43 MPSAFE { int sys_creat(const char *path, mode_t mode); } ocreat 809 STD MPSAFE RUMP { int sys_link(const char *path, const char *link); } 8110 STD MPSAFE RUMP { int sys_unlink(const char *path); } 8211 OBSOL execv 8312 STD MPSAFE RUMP { int sys_chdir(const char *path); } 8413 STD MPSAFE RUMP { int sys_fchdir(int fd); } 8514 STD MPSAFE RUMP { int sys_mknod(const char *path, mode_t mode, \ 86 dev_t dev); } 8715 STD MPSAFE RUMP { int sys_chmod(const char *path, mode_t mode); } 8816 STD MPSAFE RUMP { int sys_chown(const char *path, uid_t uid, \ 89 gid_t gid); } 9017 STD MPSAFE { int sys_obreak(char *nsize); } break 9118 COMPAT_20 MPSAFE { int sys_getfsstat(struct statfs12 *buf, \ 92 long bufsize, int flags); } 9319 COMPAT_43 MPSAFE { long sys_lseek(int fd, long offset, int whence); } \ 94 olseek 95#ifdef COMPAT_43 9620 STD MPSAFE { pid_t sys_getpid_with_ppid(void); } getpid 97#else 9820 STD MPSAFE { pid_t sys_getpid(void); } 99#endif 10021 COMPAT_40 MPSAFE { int sys_mount(const char *type, const char *path, \ 101 int flags, void *data); } 10222 STD MPSAFE RUMP { int sys_unmount(const char *path, int flags); } 10323 STD MPSAFE { int sys_setuid(uid_t uid); } 104#ifdef COMPAT_43 10524 STD MPSAFE { uid_t sys_getuid_with_euid(void); } getuid 106#else 10724 STD MPSAFE { uid_t sys_getuid(void); } 108#endif 10925 STD MPSAFE { uid_t sys_geteuid(void); } 11026 STD MPSAFE { int sys_ptrace(int req, pid_t pid, void *addr, \ 111 int data); } 11227 STD MPSAFE { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ 113 int flags); } 11428 STD MPSAFE { ssize_t sys_sendmsg(int s, \ 115 const struct msghdr *msg, int flags); } 11629 STD MPSAFE { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ 117 int flags, struct sockaddr *from, \ 118 unsigned int *fromlenaddr); } 11930 STD { int sys_accept(int s, struct sockaddr *name, \ 120 unsigned int *anamelen); } 12131 STD { int sys_getpeername(int fdes, struct sockaddr *asa, \ 122 unsigned int *alen); } 12332 STD { int sys_getsockname(int fdes, struct sockaddr *asa, \ 124 unsigned int *alen); } 12533 STD MPSAFE RUMP { int sys_access(const char *path, int flags); } 12634 STD MPSAFE RUMP { int sys_chflags(const char *path, u_long flags); } 12735 STD MPSAFE RUMP { int sys_fchflags(int fd, u_long flags); } 12836 STD MPSAFE RUMP { void sys_sync(void); } 12937 STD MPSAFE { int sys_kill(int pid, int signum); } 13038 COMPAT_43 MPSAFE { int sys_stat(const char *path, struct stat43 *ub); } \ 131 stat43 13239 STD MPSAFE { pid_t sys_getppid(void); } 13340 COMPAT_43 MPSAFE { int sys_lstat(const char *path, \ 134 struct stat43 *ub); } lstat43 13541 STD MPSAFE { int sys_dup(int fd); } 13642 STD MPSAFE { int sys_pipe(void); } 13743 STD MPSAFE { gid_t sys_getegid(void); } 13844 STD MPSAFE { int sys_profil(char *samples, size_t size, \ 139 u_long offset, u_int scale); } 14045 STD MPSAFE { int sys_ktrace(const char *fname, int ops, \ 141 int facs, int pid); } 14246 COMPAT_13 MPSAFE { int sys_sigaction(int signum, \ 143 const struct sigaction13 *nsa, \ 144 struct sigaction13 *osa); } sigaction13 145#ifdef COMPAT_43 14647 STD MPSAFE { gid_t sys_getgid_with_egid(void); } getgid 147#else 14847 STD MPSAFE { gid_t sys_getgid(void); } 149#endif 15048 COMPAT_13 MPSAFE { int sys_sigprocmask(int how, \ 151 int mask); } sigprocmask13 15249 STD MPSAFE { int sys___getlogin(char *namebuf, size_t namelen); } 15350 STD MPSAFE { int sys___setlogin(const char *namebuf); } 15451 STD MPSAFE { int sys_acct(const char *path); } 15552 COMPAT_13 MPSAFE { int sys_sigpending(void); } sigpending13 15653 COMPAT_13 MPSAFE { int sys_sigaltstack( \ 157 const struct sigaltstack13 *nss, \ 158 struct sigaltstack13 *oss); } sigaltstack13 15954 STD MPSAFE { int sys_ioctl(int fd, \ 160 u_long com, ... void *data); } 16155 COMPAT_12 { int sys_reboot(int opt); } oreboot 16256 STD MPSAFE { int sys_revoke(const char *path); } 16357 STD MPSAFE RUMP { int sys_symlink(const char *path, \ 164 const char *link); } 16558 STD MPSAFE RUMP { ssize_t sys_readlink(const char *path, char *buf, \ 166 size_t count); } 16759 STD MPSAFE { int sys_execve(const char *path, \ 168 char * const *argp, char * const *envp); } 16960 STD MPSAFE { mode_t sys_umask(mode_t newmask); } 17061 STD MPSAFE { int sys_chroot(const char *path); } 17162 COMPAT_43 MPSAFE { int sys_fstat(int fd, struct stat43 *sb); } fstat43 17263 COMPAT_43 MPSAFE { int sys_getkerninfo(int op, char *where, int *size, \ 173 int arg); } ogetkerninfo 17464 COMPAT_43 MPSAFE { int sys_getpagesize(void); } ogetpagesize 17565 COMPAT_12 MPSAFE { int sys_msync(void *addr, size_t len); } 176; XXX COMPAT_??? for 4.4BSD-compatible vfork(2)? 17766 STD MPSAFE { int sys_vfork(void); } 17867 OBSOL vread 17968 OBSOL vwrite 18069 STD MPSAFE { int sys_sbrk(intptr_t incr); } 18170 STD MPSAFE { int sys_sstk(int incr); } 18271 COMPAT_43 MPSAFE { int sys_mmap(void *addr, size_t len, int prot, \ 183 int flags, int fd, long pos); } ommap 18472 STD MPSAFE { int sys_ovadvise(int anom); } vadvise 18573 STD MPSAFE { int sys_munmap(void *addr, size_t len); } 18674 STD MPSAFE { int sys_mprotect(void *addr, size_t len, \ 187 int prot); } 18875 STD MPSAFE { int sys_madvise(void *addr, size_t len, \ 189 int behav); } 19076 OBSOL vhangup 19177 OBSOL vlimit 19278 STD MPSAFE { int sys_mincore(void *addr, size_t len, \ 193 char *vec); } 19479 STD MPSAFE { int sys_getgroups(int gidsetsize, \ 195 gid_t *gidset); } 19680 STD MPSAFE { int sys_setgroups(int gidsetsize, \ 197 const gid_t *gidset); } 19881 STD MPSAFE { int sys_getpgrp(void); } 19982 STD MPSAFE { int sys_setpgid(int pid, int pgid); } 20083 STD MPSAFE { int sys_setitimer(int which, \ 201 const struct itimerval *itv, \ 202 struct itimerval *oitv); } 20384 COMPAT_43 MPSAFE { int sys_wait(void); } owait 20485 COMPAT_12 MPSAFE { int sys_swapon(const char *name); } oswapon 20586 STD MPSAFE { int sys_getitimer(int which, \ 206 struct itimerval *itv); } 20787 COMPAT_43 MPSAFE { int sys_gethostname(char *hostname, u_int len); } \ 208 ogethostname 20988 COMPAT_43 MPSAFE { int sys_sethostname(char *hostname, u_int len); } \ 210 osethostname 21189 COMPAT_43 MPSAFE { int sys_getdtablesize(void); } ogetdtablesize 21290 STD MPSAFE { int sys_dup2(int from, int to); } 21391 UNIMPL getdopt 21492 STD MPSAFE { int sys_fcntl(int fd, int cmd, ... void *arg); } 21593 STD MPSAFE { int sys_select(int nd, fd_set *in, fd_set *ou, \ 216 fd_set *ex, struct timeval *tv); } 21794 UNIMPL setdopt 21895 STD MPSAFE { int sys_fsync(int fd); } 21996 STD MPSAFE { int sys_setpriority(int which, id_t who, int prio); } 22097 COMPAT_30 { int sys_socket(int domain, int type, int protocol); } 22198 STD { int sys_connect(int s, const struct sockaddr *name, \ 222 unsigned int namelen); } 22399 COMPAT_43 { int sys_accept(int s, void *name, \ 224 int *anamelen); } oaccept 225100 STD MPSAFE { int sys_getpriority(int which, id_t who); } 226101 COMPAT_43 MPSAFE { int sys_send(int s, void *buf, int len, \ 227 int flags); } osend 228102 COMPAT_43 MPSAFE { int sys_recv(int s, void *buf, int len, \ 229 int flags); } orecv 230103 COMPAT_13 MPSAFE { int sys_sigreturn(struct sigcontext13 *sigcntxp); } \ 231 sigreturn13 232104 STD { int sys_bind(int s, const struct sockaddr *name, \ 233 unsigned int namelen); } 234105 STD { int sys_setsockopt(int s, int level, int name, \ 235 const void *val, unsigned int valsize); } 236106 STD { int sys_listen(int s, int backlog); } 237107 OBSOL vtimes 238108 COMPAT_43 MPSAFE { int sys_sigvec(int signum, struct sigvec *nsv, \ 239 struct sigvec *osv); } osigvec 240109 COMPAT_43 MPSAFE { int sys_sigblock(int mask); } osigblock 241110 COMPAT_43 MPSAFE { int sys_sigsetmask(int mask); } osigsetmask 242111 COMPAT_13 MPSAFE { int sys_sigsuspend(int mask); } sigsuspend13 243112 COMPAT_43 MPSAFE { int sys_sigstack(struct sigstack *nss, \ 244 struct sigstack *oss); } osigstack 245113 COMPAT_43 MPSAFE { int sys_recvmsg(int s, struct omsghdr *msg, \ 246 int flags); } orecvmsg 247114 COMPAT_43 MPSAFE { int sys_sendmsg(int s, void *msg, int flags); } \ 248 osendmsg 249115 OBSOL vtrace 250116 STD MPSAFE { int sys_gettimeofday(struct timeval *tp, \ 251 void *tzp); } 252117 STD MPSAFE { int sys_getrusage(int who, struct rusage *rusage); } 253118 STD { int sys_getsockopt(int s, int level, int name, \ 254 void *val, unsigned int *avalsize); } 255119 OBSOL resuba 256120 STD MPSAFE { ssize_t sys_readv(int fd, \ 257 const struct iovec *iovp, int iovcnt); } 258121 STD MPSAFE { ssize_t sys_writev(int fd, \ 259 const struct iovec *iovp, int iovcnt); } 260122 STD MPSAFE { int sys_settimeofday(const struct timeval *tv, \ 261 const void *tzp); } 262123 STD MPSAFE { int sys_fchown(int fd, uid_t uid, gid_t gid); } 263124 STD MPSAFE { int sys_fchmod(int fd, mode_t mode); } 264125 COMPAT_43 MPSAFE { int sys_recvfrom(int s, void *buf, size_t len, \ 265 int flags, void *from, int *fromlenaddr); } \ 266 orecvfrom 267126 STD MPSAFE { int sys_setreuid(uid_t ruid, uid_t euid); } 268127 STD MPSAFE { int sys_setregid(gid_t rgid, gid_t egid); } 269128 STD MPSAFE RUMP { int sys_rename(const char *from, const char *to); } 270129 COMPAT_43 MPSAFE { int sys_truncate(const char *path, long length); } \ 271 otruncate 272130 COMPAT_43 MPSAFE { int sys_ftruncate(int fd, long length); } oftruncate 273131 STD MPSAFE { int sys_flock(int fd, int how); } 274132 STD MPSAFE { int sys_mkfifo(const char *path, mode_t mode); } 275133 STD MPSAFE { ssize_t sys_sendto(int s, const void *buf, \ 276 size_t len, int flags, const struct sockaddr *to, \ 277 unsigned int tolen); } 278134 STD { int sys_shutdown(int s, int how); } 279135 STD { int sys_socketpair(int domain, int type, \ 280 int protocol, int *rsv); } 281136 STD MPSAFE RUMP { int sys_mkdir(const char *path, mode_t mode); } 282137 STD MPSAFE RUMP { int sys_rmdir(const char *path); } 283138 STD MPSAFE { int sys_utimes(const char *path, \ 284 const struct timeval *tptr); } 285139 OBSOL 4.2 sigreturn 286140 STD { int sys_adjtime(const struct timeval *delta, \ 287 struct timeval *olddelta); } 288141 COMPAT_43 { int sys_getpeername(int fdes, void *asa, \ 289 int *alen); } ogetpeername 290142 COMPAT_43 MPSAFE { int32_t sys_gethostid(void); } ogethostid 291143 COMPAT_43 MPSAFE { int sys_sethostid(int32_t hostid); } osethostid 292144 COMPAT_43 MPSAFE { int sys_getrlimit(int which, \ 293 struct orlimit *rlp); } ogetrlimit 294145 COMPAT_43 MPSAFE { int sys_setrlimit(int which, \ 295 const struct orlimit *rlp); } osetrlimit 296146 COMPAT_43 MPSAFE { int sys_killpg(int pgid, int signum); } okillpg 297147 STD MPSAFE { int sys_setsid(void); } 298148 STD MPSAFE { int sys_quotactl(const char *path, int cmd, \ 299 int uid, void *arg); } 300149 COMPAT_43 MPSAFE { int sys_quota(void); } oquota 301150 COMPAT_43 { int sys_getsockname(int fdec, void *asa, \ 302 int *alen); } ogetsockname 303 304; Syscalls 151-180 inclusive are reserved for vendor-specific 305; system calls. (This includes various calls added for compatibity 306; with other Unix variants.) 307; Some of these calls are now supported by BSD... 308151 UNIMPL 309152 UNIMPL 310153 UNIMPL 311154 UNIMPL 312#if defined(NFS) || defined(NFSSERVER) || !defined(_KERNEL) 313155 STD MPSAFE { int sys_nfssvc(int flag, void *argp); } 314#else 315155 EXCL nfssvc 316#endif 317156 COMPAT_43 MPSAFE { int sys_getdirentries(int fd, char *buf, \ 318 u_int count, long *basep); } ogetdirentries 319157 COMPAT_20 MPSAFE { int sys_statfs(const char *path, \ 320 struct statfs12 *buf); } 321158 COMPAT_20 MPSAFE { int sys_fstatfs(int fd, struct statfs12 *buf); } 322159 UNIMPL 323160 UNIMPL 324161 COMPAT_30 MPSAFE { int sys_getfh(const char *fname, \ 325 struct compat_30_fhandle *fhp); } 326162 COMPAT_09 MPSAFE { int sys_getdomainname(char *domainname, int len); } \ 327 ogetdomainname 328163 COMPAT_09 MPSAFE { int sys_setdomainname(char *domainname, int len); } \ 329 osetdomainname 330164 COMPAT_09 MPSAFE { int sys_uname(struct outsname *name); } ouname 331165 STD { int sys_sysarch(int op, void *parms); } 332166 UNIMPL 333167 UNIMPL 334168 UNIMPL 335; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 336#if (defined(SYSVSEM) || !defined(_KERNEL)) && !defined(_LP64) 337169 COMPAT_10 MPSAFE { int sys_semsys(int which, int a2, int a3, int a4, \ 338 int a5); } osemsys 339#else 340169 EXCL 1.0 semsys 341#endif 342; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 343#if (defined(SYSVMSG) || !defined(_KERNEL)) && !defined(_LP64) 344170 COMPAT_10 MPSAFE { int sys_msgsys(int which, int a2, int a3, int a4, \ 345 int a5, int a6); } omsgsys 346#else 347170 EXCL 1.0 msgsys 348#endif 349; XXX more generally, never on machines where sizeof(void *) != sizeof(int) 350#if (defined(SYSVSHM) || !defined(_KERNEL)) && !defined(_LP64) 351171 COMPAT_10 MPSAFE { int sys_shmsys(int which, int a2, int a3, int a4); } \ 352 oshmsys 353#else 354171 EXCL 1.0 shmsys 355#endif 356172 UNIMPL 357173 STD MPSAFE { ssize_t sys_pread(int fd, void *buf, \ 358 size_t nbyte, int pad, off_t offset); } 359174 STD MPSAFE { ssize_t sys_pwrite(int fd, const void *buf, \ 360 size_t nbyte, int pad, off_t offset); } 361; For some reason, ntp_gettime doesn't want to raise SIGSYS when it's excluded. 362175 COMPAT_30 { int sys_ntp_gettime(struct ntptimeval30 *ntvp); } 363#if defined(NTP) || !defined(_KERNEL) 364176 STD { int sys_ntp_adjtime(struct timex *tp); } 365#else 366176 EXCL ntp_adjtime 367#endif 368177 UNIMPL 369178 UNIMPL 370179 UNIMPL 371180 UNIMPL 372 373; Syscalls 180-199 are used by/reserved for BSD 374181 STD MPSAFE { int sys_setgid(gid_t gid); } 375182 STD MPSAFE { int sys_setegid(gid_t egid); } 376183 STD MPSAFE { int sys_seteuid(uid_t euid); } 377#if defined(LFS) || !defined(_KERNEL) 378184 STD { int sys_lfs_bmapv(fsid_t *fsidp, \ 379 struct block_info *blkiov, int blkcnt); } 380185 STD { int sys_lfs_markv(fsid_t *fsidp, \ 381 struct block_info *blkiov, int blkcnt); } 382186 STD { int sys_lfs_segclean(fsid_t *fsidp, u_long segment); } 383187 STD { int sys_lfs_segwait(fsid_t *fsidp, \ 384 struct timeval *tv); } 385#else 386184 EXCL lfs_bmapv 387185 EXCL lfs_markv 388186 EXCL lfs_segclean 389187 EXCL lfs_segwait 390#endif 391188 COMPAT_12 MPSAFE { int sys_stat(const char *path, struct stat12 *ub); } \ 392 stat12 393189 COMPAT_12 MPSAFE { int sys_fstat(int fd, struct stat12 *sb); } fstat12 394190 COMPAT_12 MPSAFE { int sys_lstat(const char *path, \ 395 struct stat12 *ub); } lstat12 396191 STD MPSAFE { long sys_pathconf(const char *path, int name); } 397192 STD MPSAFE { long sys_fpathconf(int fd, int name); } 398193 UNIMPL 399194 STD MPSAFE { int sys_getrlimit(int which, \ 400 struct rlimit *rlp); } 401195 STD MPSAFE { int sys_setrlimit(int which, \ 402 const struct rlimit *rlp); } 403196 COMPAT_12 MPSAFE { int sys_getdirentries(int fd, char *buf, \ 404 u_int count, long *basep); } 405197 STD MPSAFE { void *sys_mmap(void *addr, size_t len, int prot, \ 406 int flags, int fd, long pad, off_t pos); } 407198 INDIR { quad_t sys___syscall(quad_t code, \ 408 ... register_t args[SYS_MAXSYSARGS]); } 409199 STD MPSAFE { off_t sys_lseek(int fd, int pad, off_t offset, \ 410 int whence); } 411200 STD MPSAFE RUMP { int sys_truncate(const char *path, int pad, \ 412 off_t length); } 413201 STD MPSAFE { int sys_ftruncate(int fd, int pad, off_t length); } 414202 STD MPSAFE { int sys___sysctl(const int *name, u_int namelen, \ 415 void *old, size_t *oldlenp, const void *new, \ 416 size_t newlen); } 417203 STD MPSAFE { int sys_mlock(const void *addr, size_t len); } 418204 STD MPSAFE { int sys_munlock(const void *addr, size_t len); } 419205 STD MPSAFE { int sys_undelete(const char *path); } 420206 STD MPSAFE { int sys_futimes(int fd, \ 421 const struct timeval *tptr); } 422207 STD MPSAFE { pid_t sys_getpgid(pid_t pid); } 423208 STD { int sys_reboot(int opt, char *bootstr); } 424209 STD MPSAFE { int sys_poll(struct pollfd *fds, u_int nfds, \ 425 int timeout); } 426; 427; Syscalls 210-219 are reserved for dynamically loaded syscalls 428; 429#if defined(LKM) || !defined(_KERNEL) 430210 NODEF { int sys_lkmnosys(void); } 431211 NODEF { int sys_lkmnosys(void); } 432212 NODEF { int sys_lkmnosys(void); } 433213 NODEF { int sys_lkmnosys(void); } 434214 NODEF { int sys_lkmnosys(void); } 435215 NODEF { int sys_lkmnosys(void); } 436216 NODEF { int sys_lkmnosys(void); } 437217 NODEF { int sys_lkmnosys(void); } 438218 NODEF { int sys_lkmnosys(void); } 439219 NODEF { int sys_lkmnosys(void); } 440#else /* !LKM */ 441210 EXCL lkmnosys 442211 EXCL lkmnosys 443212 EXCL lkmnosys 444213 EXCL lkmnosys 445214 EXCL lkmnosys 446215 EXCL lkmnosys 447216 EXCL lkmnosys 448217 EXCL lkmnosys 449218 EXCL lkmnosys 450219 EXCL lkmnosys 451#endif /* !LKM */ 452; System calls 220-300 are reserved for use by NetBSD 453#if defined(SYSVSEM) || !defined(_KERNEL) 454220 COMPAT_14 MPSAFE { int sys___semctl(int semid, int semnum, int cmd, \ 455 union __semun *arg); } 456221 STD MPSAFE { int sys_semget(key_t key, int nsems, int semflg); } 457222 STD MPSAFE { int sys_semop(int semid, struct sembuf *sops, \ 458 size_t nsops); } 459223 STD MPSAFE { int sys_semconfig(int flag); } 460#else 461220 EXCL compat_14_semctl 462221 EXCL semget 463222 EXCL semop 464223 EXCL semconfig 465#endif 466#if defined(SYSVMSG) || !defined(_KERNEL) 467224 COMPAT_14 MPSAFE { int sys_msgctl(int msqid, int cmd, \ 468 struct msqid_ds14 *buf); } 469225 STD MPSAFE { int sys_msgget(key_t key, int msgflg); } 470226 STD MPSAFE { int sys_msgsnd(int msqid, const void *msgp, \ 471 size_t msgsz, int msgflg); } 472227 STD MPSAFE { ssize_t sys_msgrcv(int msqid, void *msgp, \ 473 size_t msgsz, long msgtyp, int msgflg); } 474#else 475224 EXCL compat_14_msgctl 476225 EXCL msgget 477226 EXCL msgsnd 478227 EXCL msgrcv 479#endif 480#if defined(SYSVSHM) || !defined(_KERNEL) 481228 STD MPSAFE { void *sys_shmat(int shmid, const void *shmaddr, \ 482 int shmflg); } 483229 COMPAT_14 MPSAFE { int sys_shmctl(int shmid, int cmd, \ 484 struct shmid_ds14 *buf); } 485230 STD MPSAFE { int sys_shmdt(const void *shmaddr); } 486231 STD MPSAFE { int sys_shmget(key_t key, size_t size, int shmflg); } 487#else 488228 EXCL shmat 489229 EXCL compat_14_shmctl 490230 EXCL shmdt 491231 EXCL shmget 492#endif 493232 STD MPSAFE { int sys_clock_gettime(clockid_t clock_id, \ 494 struct timespec *tp); } 495233 STD MPSAFE { int sys_clock_settime(clockid_t clock_id, \ 496 const struct timespec *tp); } 497234 STD MPSAFE { int sys_clock_getres(clockid_t clock_id, \ 498 struct timespec *tp); } 499235 STD MPSAFE { int sys_timer_create(clockid_t clock_id, \ 500 struct sigevent *evp, timer_t *timerid); } 501236 STD MPSAFE { int sys_timer_delete(timer_t timerid); } 502237 STD MPSAFE { int sys_timer_settime(timer_t timerid, int flags, \ 503 const struct itimerspec *value, \ 504 struct itimerspec *ovalue); } 505238 STD MPSAFE { int sys_timer_gettime(timer_t timerid, struct \ 506 itimerspec *value); } 507239 STD MPSAFE { int sys_timer_getoverrun(timer_t timerid); } 508; 509; Syscalls 240-269 are reserved for other IEEE Std1003.1b syscalls 510; 511240 STD MPSAFE { int sys_nanosleep(const struct timespec *rqtp, \ 512 struct timespec *rmtp); } 513241 STD MPSAFE { int sys_fdatasync(int fd); } 514242 STD MPSAFE { int sys_mlockall(int flags); } 515243 STD MPSAFE { int sys_munlockall(void); } 516244 STD MPSAFE { int sys___sigtimedwait(const sigset_t *set, \ 517 siginfo_t *info, \ 518 struct timespec *timeout); } 519245 UNIMPL sys_sigqueue 520246 STD MPSAFE { int sys_modctl(int cmd, void *arg); } 521#if defined(P1003_1B_SEMAPHORE) || (!defined(_KERNEL) && defined(_LIBC)) 522247 STD MPSAFE { int sys__ksem_init(unsigned int value, semid_t *idp); } 523248 STD MPSAFE { int sys__ksem_open(const char *name, int oflag, \ 524 mode_t mode, unsigned int value, semid_t *idp); } 525249 STD MPSAFE { int sys__ksem_unlink(const char *name); } 526250 STD MPSAFE { int sys__ksem_close(semid_t id); } 527251 STD MPSAFE { int sys__ksem_post(semid_t id); } 528252 STD MPSAFE { int sys__ksem_wait(semid_t id); } 529253 STD MPSAFE { int sys__ksem_trywait(semid_t id); } 530254 STD MPSAFE { int sys__ksem_getvalue(semid_t id, \ 531 unsigned int *value); } 532255 STD MPSAFE { int sys__ksem_destroy(semid_t id); } 533256 UNIMPL sys__ksem_timedwait 534#else 535247 EXCL sys__ksem_init 536248 EXCL sys__ksem_open 537249 EXCL sys__ksem_unlink 538250 EXCL sys__ksem_close 539251 EXCL sys__ksem_post 540252 EXCL sys__ksem_wait 541253 EXCL sys__ksem_trywait 542254 EXCL sys__ksem_getvalue 543255 EXCL sys__ksem_destroy 544256 UNIMPL sys__ksem_timedwait 545#endif 546257 STD MPSAFE { mqd_t sys_mq_open(const char * name, int oflag, \ 547 mode_t mode, struct mq_attr *attr); } 548258 STD MPSAFE { int sys_mq_close(mqd_t mqdes); } 549259 STD MPSAFE { int sys_mq_unlink(const char *name); } 550260 STD MPSAFE { int sys_mq_getattr(mqd_t mqdes, \ 551 struct mq_attr *mqstat); } 552261 STD MPSAFE { int sys_mq_setattr(mqd_t mqdes, \ 553 const struct mq_attr *mqstat, \ 554 struct mq_attr *omqstat); } 555262 STD MPSAFE { int sys_mq_notify(mqd_t mqdes, \ 556 const struct sigevent *notification); } 557263 STD MPSAFE { int sys_mq_send(mqd_t mqdes, const char *msg_ptr, \ 558 size_t msg_len, unsigned msg_prio); } 559264 STD MPSAFE { ssize_t sys_mq_receive(mqd_t mqdes, char *msg_ptr, \ 560 size_t msg_len, unsigned *msg_prio); } 561265 STD MPSAFE { int sys_mq_timedsend(mqd_t mqdes, \ 562 const char *msg_ptr, size_t msg_len, \ 563 unsigned msg_prio, \ 564 const struct timespec *abs_timeout); } 565266 STD MPSAFE { ssize_t sys_mq_timedreceive(mqd_t mqdes, \ 566 char *msg_ptr, size_t msg_len, unsigned *msg_prio, \ 567 const struct timespec *abs_timeout); } 568267 UNIMPL 569268 UNIMPL 570269 UNIMPL 571270 STD MPSAFE { int sys___posix_rename(const char *from, \ 572 const char *to); } 573271 STD MPSAFE { int sys_swapctl(int cmd, void *arg, int misc); } 574272 COMPAT_30 MPSAFE { int sys_getdents(int fd, char *buf, size_t count); } 575273 STD MPSAFE { int sys_minherit(void *addr, size_t len, \ 576 int inherit); } 577274 STD MPSAFE RUMP { int sys_lchmod(const char *path, mode_t mode); } 578275 STD MPSAFE RUMP { int sys_lchown(const char *path, uid_t uid, \ 579 gid_t gid); } 580276 STD MPSAFE { int sys_lutimes(const char *path, \ 581 const struct timeval *tptr); } 582277 STD MPSAFE { int sys___msync13(void *addr, size_t len, int flags); } 583278 COMPAT_30 MPSAFE { int sys___stat13(const char *path, struct stat13 *ub); } 584279 COMPAT_30 MPSAFE { int sys___fstat13(int fd, struct stat13 *sb); } 585280 COMPAT_30 MPSAFE { int sys___lstat13(const char *path, struct stat13 *ub); } 586281 STD MPSAFE { int sys___sigaltstack14( \ 587 const struct sigaltstack *nss, \ 588 struct sigaltstack *oss); } 589282 STD MPSAFE { int sys___vfork14(void); } 590283 STD MPSAFE { int sys___posix_chown(const char *path, uid_t uid, \ 591 gid_t gid); } 592284 STD MPSAFE { int sys___posix_fchown(int fd, uid_t uid, \ 593 gid_t gid); } 594285 STD MPSAFE { int sys___posix_lchown(const char *path, uid_t uid, \ 595 gid_t gid); } 596286 STD MPSAFE { pid_t sys_getsid(pid_t pid); } 597287 STD MPSAFE { pid_t sys___clone(int flags, void *stack); } 598288 STD MPSAFE { int sys_fktrace(int fd, int ops, \ 599 int facs, int pid); } 600289 STD MPSAFE { ssize_t sys_preadv(int fd, \ 601 const struct iovec *iovp, int iovcnt, \ 602 int pad, off_t offset); } 603290 STD MPSAFE { ssize_t sys_pwritev(int fd, \ 604 const struct iovec *iovp, int iovcnt, \ 605 int pad, off_t offset); } 606291 COMPAT_16 MPSAFE { int sys___sigaction14(int signum, \ 607 const struct sigaction *nsa, \ 608 struct sigaction *osa); } 609292 STD MPSAFE { int sys___sigpending14(sigset_t *set); } 610293 STD MPSAFE { int sys___sigprocmask14(int how, \ 611 const sigset_t *set, \ 612 sigset_t *oset); } 613294 STD MPSAFE { int sys___sigsuspend14(const sigset_t *set); } 614295 COMPAT_16 MPSAFE { int sys___sigreturn14(struct sigcontext *sigcntxp); } 615296 STD MPSAFE { int sys___getcwd(char *bufp, size_t length); } 616297 STD MPSAFE { int sys_fchroot(int fd); } 617298 COMPAT_30 MPSAFE { int sys_fhopen(const struct compat_30_fhandle *fhp, int flags); } 618299 COMPAT_30 MPSAFE { int sys_fhstat(const struct compat_30_fhandle *fhp, \ 619 struct stat13 *sb); } 620300 COMPAT_20 MPSAFE { int sys_fhstatfs(const struct compat_30_fhandle *fhp, \ 621 struct statfs12 *buf); } 622#if defined(SYSVSEM) || !defined(_KERNEL) 623301 STD MPSAFE { int sys_____semctl13(int semid, int semnum, int cmd, \ 624 ... union __semun *arg); } 625#else 626301 EXCL ____semctl13 627#endif 628#if defined(SYSVMSG) || !defined(_KERNEL) 629302 STD MPSAFE { int sys___msgctl13(int msqid, int cmd, \ 630 struct msqid_ds *buf); } 631#else 632302 EXCL __msgctl13 633#endif 634#if defined(SYSVSHM) || !defined(_KERNEL) 635303 STD MPSAFE { int sys___shmctl13(int shmid, int cmd, \ 636 struct shmid_ds *buf); } 637#else 638303 EXCL __shmctl13 639#endif 640304 STD MPSAFE { int sys_lchflags(const char *path, u_long flags); } 641305 STD MPSAFE { int sys_issetugid(void); } 642306 STD MPSAFE { int sys_utrace(const char *label, void *addr, \ 643 size_t len); } 644307 STD MPSAFE { int sys_getcontext(struct __ucontext *ucp); } 645308 STD MPSAFE { int sys_setcontext(const struct __ucontext *ucp); } 646309 STD MPSAFE { int sys__lwp_create(const struct __ucontext *ucp, \ 647 u_long flags, lwpid_t *new_lwp); } 648310 STD MPSAFE { int sys__lwp_exit(void); } 649311 STD MPSAFE { lwpid_t sys__lwp_self(void); } 650312 STD MPSAFE { int sys__lwp_wait(lwpid_t wait_for, \ 651 lwpid_t *departed); } 652313 STD MPSAFE { int sys__lwp_suspend(lwpid_t target); } 653314 STD MPSAFE { int sys__lwp_continue(lwpid_t target); } 654315 STD MPSAFE { int sys__lwp_wakeup(lwpid_t target); } 655316 STD MPSAFE { void *sys__lwp_getprivate(void); } 656317 STD MPSAFE { void sys__lwp_setprivate(void *ptr); } 657318 STD MPSAFE { int sys__lwp_kill(lwpid_t target, int signo); } 658319 STD MPSAFE { int sys__lwp_detach(lwpid_t target); } 659320 STD MPSAFE { int sys__lwp_park(const struct timespec *ts, \ 660 lwpid_t unpark, const void *hint, \ 661 const void *unparkhint); } 662321 STD MPSAFE { int sys__lwp_unpark(lwpid_t target, const void *hint); } 663322 STD MPSAFE { ssize_t sys__lwp_unpark_all(const lwpid_t *targets, \ 664 size_t ntargets, const void *hint); } 665323 STD MPSAFE { int sys__lwp_setname(lwpid_t target, \ 666 const char *name); } 667324 STD MPSAFE { int sys__lwp_getname(lwpid_t target, \ 668 char *name, size_t len); } 669325 STD MPSAFE { int sys__lwp_ctl(int features, \ 670 struct lwpctl **address); } 671; Syscalls 326-339 reserved for LWP syscalls. 672326 UNIMPL 673327 UNIMPL 674328 UNIMPL 675329 UNIMPL 676; Obsolete SA system calls. Must remain until libc's major version is bumped. 677330 STD MPSAFE { int sys_sa_register(void); } 678331 STD MPSAFE { int sys_sa_stacks(void); } 679332 STD MPSAFE { int sys_sa_enable(void); } 680333 STD MPSAFE { int sys_sa_setconcurrency(void); } 681334 STD MPSAFE { int sys_sa_yield(void); } 682335 STD MPSAFE { int sys_sa_preempt(void); } 683336 STD MPSAFE { int sys_sa_unblockyield(void); } 684337 UNIMPL 685338 UNIMPL 686339 UNIMPL 687340 STD MPSAFE { int sys___sigaction_sigtramp(int signum, \ 688 const struct sigaction *nsa, \ 689 struct sigaction *osa, \ 690 const void *tramp, int vers); } 691341 STD { int sys_pmc_get_info(int ctr, int op, void *args); } 692342 STD { int sys_pmc_control(int ctr, int op, void *args); } 693343 STD MPSAFE { int sys_rasctl(void *addr, size_t len, int op); } 694344 STD MPSAFE { int sys_kqueue(void); } 695345 STD MPSAFE { int sys_kevent(int fd, \ 696 const struct kevent *changelist, size_t nchanges, \ 697 struct kevent *eventlist, size_t nevents, \ 698 const struct timespec *timeout); } 699 700; Scheduling system calls. 701346 STD MPSAFE { int sys__sched_setparam(pid_t pid, lwpid_t lid, \ 702 int policy, const struct sched_param *params); } 703347 STD MPSAFE { int sys__sched_getparam(pid_t pid, lwpid_t lid, \ 704 int *policy, struct sched_param *params); } 705348 STD MPSAFE { int sys__sched_setaffinity(pid_t pid, lwpid_t lid, \ 706 size_t size, void *cpuset); } 707349 STD MPSAFE { int sys__sched_getaffinity(pid_t pid, lwpid_t lid, \ 708 size_t size, void *cpuset); } 709350 STD MPSAFE { int sys_sched_yield(void); } 710351 UNIMPL 711352 UNIMPL 712353 UNIMPL 713 714354 STD MPSAFE { int sys_fsync_range(int fd, int flags, off_t start, \ 715 off_t length); } 716355 STD MPSAFE { int sys_uuidgen(struct uuid *store, int count); } 717356 STD MPSAFE { int sys_getvfsstat(struct statvfs *buf, \ 718 size_t bufsize, int flags); } 719357 STD MPSAFE { int sys_statvfs1(const char *path, \ 720 struct statvfs *buf, int flags); } 721358 STD MPSAFE { int sys_fstatvfs1(int fd, struct statvfs *buf, \ 722 int flags); } 723359 COMPAT_30 MPSAFE { int sys_fhstatvfs1(const struct compat_30_fhandle *fhp, \ 724 struct statvfs *buf, int flags); } 725360 STD MPSAFE { int sys_extattrctl(const char *path, int cmd, \ 726 const char *filename, int attrnamespace, \ 727 const char *attrname); } 728361 STD MPSAFE { int sys_extattr_set_file(const char *path, \ 729 int attrnamespace, const char *attrname, \ 730 const void *data, size_t nbytes); } 731362 STD MPSAFE { ssize_t sys_extattr_get_file(const char *path, \ 732 int attrnamespace, const char *attrname, \ 733 void *data, size_t nbytes); } 734363 STD MPSAFE { int sys_extattr_delete_file(const char *path, \ 735 int attrnamespace, const char *attrname); } 736364 STD MPSAFE { int sys_extattr_set_fd(int fd, \ 737 int attrnamespace, const char *attrname, \ 738 const void *data, size_t nbytes); } 739365 STD MPSAFE { ssize_t sys_extattr_get_fd(int fd, \ 740 int attrnamespace, const char *attrname, \ 741 void *data, size_t nbytes); } 742366 STD MPSAFE { int sys_extattr_delete_fd(int fd, \ 743 int attrnamespace, const char *attrname); } 744367 STD MPSAFE { int sys_extattr_set_link(const char *path, \ 745 int attrnamespace, const char *attrname, \ 746 const void *data, size_t nbytes); } 747368 STD MPSAFE { ssize_t sys_extattr_get_link(const char *path, \ 748 int attrnamespace, const char *attrname, \ 749 void *data, size_t nbytes); } 750369 STD MPSAFE { int sys_extattr_delete_link(const char *path, \ 751 int attrnamespace, const char *attrname); } 752370 STD MPSAFE { ssize_t sys_extattr_list_fd(int fd, \ 753 int attrnamespace, void *data, size_t nbytes); } 754371 STD MPSAFE { ssize_t sys_extattr_list_file(const char *path, \ 755 int attrnamespace, void *data, size_t nbytes); } 756372 STD MPSAFE { ssize_t sys_extattr_list_link(const char *path, \ 757 int attrnamespace, void *data, size_t nbytes); } 758373 STD MPSAFE { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ 759 fd_set *ex, const struct timespec *ts, \ 760 const sigset_t *mask); } 761374 STD MPSAFE { int sys_pollts(struct pollfd *fds, u_int nfds, \ 762 const struct timespec *ts, const sigset_t *mask); } 763375 STD MPSAFE { int sys_setxattr(const char *path, \ 764 const char *name, void *value, size_t size, \ 765 int flags); } 766376 STD MPSAFE { int sys_lsetxattr(const char *path, \ 767 const char *name, void *value, size_t size, \ 768 int flags); } 769377 STD MPSAFE { int sys_fsetxattr(int fd, \ 770 const char *name, void *value, size_t size, \ 771 int flags); } 772378 STD MPSAFE { int sys_getxattr(const char *path, \ 773 const char *name, void *value, size_t size); } 774379 STD MPSAFE { int sys_lgetxattr(const char *path, \ 775 const char *name, void *value, size_t size); } 776380 STD MPSAFE { int sys_fgetxattr(int fd, \ 777 const char *name, void *value, size_t size); } 778381 STD MPSAFE { int sys_listxattr(const char *path, \ 779 char *list, size_t size); } 780382 STD MPSAFE { int sys_llistxattr(const char *path, \ 781 char *list, size_t size); } 782383 STD MPSAFE { int sys_flistxattr(int fd, \ 783 char *list, size_t size); } 784384 STD MPSAFE { int sys_removexattr(const char *path, \ 785 const char *name); } 786385 STD MPSAFE { int sys_lremovexattr(const char *path, \ 787 const char *name); } 788386 STD MPSAFE { int sys_fremovexattr(int fd, \ 789 const char *name); } 790387 STD MPSAFE { int sys___stat30(const char *path, struct stat *ub); } 791388 STD MPSAFE { int sys___fstat30(int fd, struct stat *sb); } 792389 STD MPSAFE { int sys___lstat30(const char *path, struct stat *ub); } 793390 STD MPSAFE { int sys___getdents30(int fd, char *buf, size_t count); } 794391 IGNORED old posix_fadvise 795392 COMPAT_30 MPSAFE { int sys___fhstat30(const struct compat_30_fhandle \ 796 *fhp, struct stat *sb); } 797393 STD { int sys___ntp_gettime30(struct ntptimeval *ntvp); } 798394 STD { int sys___socket30(int domain, int type, int protocol); } 799395 STD MPSAFE { int sys___getfh30(const char *fname, void *fhp, \ 800 size_t *fh_size); } 801396 STD MPSAFE { int sys___fhopen40(const void *fhp, size_t fh_size,\ 802 int flags); } 803397 STD MPSAFE { int sys___fhstatvfs140(const void *fhp, \ 804 size_t fh_size, struct statvfs *buf, int flags); } 805398 STD MPSAFE { int sys___fhstat40(const void *fhp, \ 806 size_t fh_size, struct stat *sb); } 807 808; Asynchronous I/O system calls 809399 STD MPSAFE { int sys_aio_cancel(int fildes, struct aiocb *aiocbp); } 810400 STD MPSAFE { int sys_aio_error(const struct aiocb *aiocbp); } 811401 STD MPSAFE { int sys_aio_fsync(int op, struct aiocb *aiocbp); } 812402 STD MPSAFE { int sys_aio_read(struct aiocb *aiocbp); } 813403 STD MPSAFE { int sys_aio_return(struct aiocb *aiocbp); } 814404 STD MPSAFE { int sys_aio_suspend(const struct aiocb *const *list, \ 815 int nent, const struct timespec *timeout); } 816405 STD MPSAFE { int sys_aio_write(struct aiocb *aiocbp); } 817406 STD MPSAFE { int sys_lio_listio(int mode, struct aiocb *const *list, \ 818 int nent, struct sigevent *sig); } 819 820407 UNIMPL 821408 UNIMPL 822409 UNIMPL 823 824410 STD MPSAFE { int sys___mount50(const char *type, \ 825 const char *path, int flags, void *data, \ 826 size_t data_len); } 827411 STD MPSAFE { void *sys_mremap(void *old_address, size_t old_size, \ 828 void *new_address, size_t new_size, int flags); } 829 830; Processor-sets system calls 831412 STD MPSAFE { int sys_pset_create(psetid_t *psid); } 832413 STD MPSAFE { int sys_pset_destroy(psetid_t psid); } 833414 STD MPSAFE { int sys_pset_assign(psetid_t psid, cpuid_t cpuid, \ 834 psetid_t *opsid); } 835415 STD MPSAFE { int sys__pset_bind(idtype_t idtype, id_t first_id, \ 836 id_t second_id, psetid_t psid, psetid_t *opsid); } 837416 STD MPSAFE { int sys___posix_fadvise50(int fd, int pad, \ 838 off_t offset, off_t len, int advice); } 839