15969a6f1SDavid P. Reese, Jr. /* 25969a6f1SDavid P. Reese, Jr. * KERN_SYSCALL.H - Split syscall prototypes 35969a6f1SDavid P. Reese, Jr. * 45969a6f1SDavid P. Reese, Jr. * Copyright (c) 2003 David P. Reese, Jr. <daver@gomerbud.com> 55969a6f1SDavid P. Reese, Jr. * All rights reserved. 65969a6f1SDavid P. Reese, Jr. * 75969a6f1SDavid P. Reese, Jr. * Redistribution and use in source and binary forms, with or without 85969a6f1SDavid P. Reese, Jr. * modification, are permitted provided that the following conditions 95969a6f1SDavid P. Reese, Jr. * are met: 105969a6f1SDavid P. Reese, Jr. * 1. Redistributions of source code must retain the above copyright 115969a6f1SDavid P. Reese, Jr. * notice, this list of conditions and the following disclaimer. 125969a6f1SDavid P. Reese, Jr. * 2. Redistributions in binary form must reproduce the above copyright 135969a6f1SDavid P. Reese, Jr. * notice, this list of conditions and the following disclaimer in the 145969a6f1SDavid P. Reese, Jr. * documentation and/or other materials provided with the distribution. 155969a6f1SDavid P. Reese, Jr. * 165969a6f1SDavid P. Reese, Jr. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 175969a6f1SDavid P. Reese, Jr. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 185969a6f1SDavid P. Reese, Jr. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 195969a6f1SDavid P. Reese, Jr. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 205969a6f1SDavid P. Reese, Jr. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 215969a6f1SDavid P. Reese, Jr. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 225969a6f1SDavid P. Reese, Jr. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 235969a6f1SDavid P. Reese, Jr. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 245969a6f1SDavid P. Reese, Jr. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 255969a6f1SDavid P. Reese, Jr. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 265969a6f1SDavid P. Reese, Jr. * SUCH DAMAGE. 275969a6f1SDavid P. Reese, Jr. * 28d9fad06eSMatthew Dillon * $DragonFly: src/sys/sys/kern_syscall.h,v 1.38 2008/06/01 19:27:37 dillon Exp $ 295969a6f1SDavid P. Reese, Jr. */ 305969a6f1SDavid P. Reese, Jr. 315969a6f1SDavid P. Reese, Jr. #ifndef _SYS_KERN_SYSCALL_H_ 325969a6f1SDavid P. Reese, Jr. #define _SYS_KERN_SYSCALL_H_ 335969a6f1SDavid P. Reese, Jr. 34d9f3f6faSChris Pressey #ifndef _KERNEL 35d9f3f6faSChris Pressey #error "This file should not be included by userland programs." 36d9f3f6faSChris Pressey #endif 37d9f3f6faSChris Pressey 3853b02c48SJoerg Sonnenberger #include <sys/uio.h> 3953b02c48SJoerg Sonnenberger 40*a2988f1bSJohn Marino #define DUP_FIXED 0x1 /* Copy to specific fd even if in use */ 41*a2988f1bSJohn Marino #define DUP_VARIABLE 0x2 /* Copy fd to an unused fd */ 42*a2988f1bSJohn Marino #define DUP_CLOEXEC 0x4 /* Set fd close on exec flag */ 43dda4b42bSDavid P. Reese, Jr. union fcntl_dat; 442bd9d75cSDavid P. Reese, Jr. struct image_args; 45c0b8a06dSMatthew Dillon struct plimit; 463e1837ceSDavid P. Reese, Jr. struct mbuf; 4735fbb1d9SDavid P. Reese, Jr. struct msghdr; 4821739618SMatthew Dillon struct namecache; 4928623bf9SMatthew Dillon struct nchandle; 5021739618SMatthew Dillon struct nlookupdata; 519697c509SDavid P. Reese, Jr. struct rlimit; 529697c509SDavid P. Reese, Jr. struct rusage; 5365957d54SDavid P. Reese, Jr. struct sigaction; 5465957d54SDavid P. Reese, Jr. struct sigaltstack; 5565957d54SDavid P. Reese, Jr. struct __sigset; 5675a872f8SDavid P. Reese, Jr. struct sf_hdtr; 573e1837ceSDavid P. Reese, Jr. struct sockaddr; 5875a872f8SDavid P. Reese, Jr. struct socket; 59201305adSDavid P. Reese, Jr. struct sockopt; 6065957d54SDavid P. Reese, Jr. struct stat; 619697c509SDavid P. Reese, Jr. struct statfs; 629697c509SDavid P. Reese, Jr. struct timeval; 63ba023347SDavid P. Reese, Jr. struct uio; 64d3313941SMatthew Dillon struct vmspace; 6575a872f8SDavid P. Reese, Jr. struct vnode; 6682eaef15SMatthew Dillon struct file; 6787de5057SMatthew Dillon struct ucred; 68d7345b10SMatthew Dillon struct uuid; 69d9fad06eSMatthew Dillon struct statvfs; 705969a6f1SDavid P. Reese, Jr. 71ba023347SDavid P. Reese, Jr. /* 72ba023347SDavid P. Reese, Jr. * Prototypes for syscalls in kern/kern_descrip.c 73ba023347SDavid P. Reese, Jr. */ 74*a2988f1bSJohn Marino int kern_dup(int flags, int old, int new, int *res); 7587de5057SMatthew Dillon int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred); 768f6f8622SDavid P. Reese, Jr. int kern_fstat(int fd, struct stat *st); 77ba023347SDavid P. Reese, Jr. 78ba023347SDavid P. Reese, Jr. /* 792bd9d75cSDavid P. Reese, Jr. * Prototypes for syscalls in kern/kern_exec.c 802bd9d75cSDavid P. Reese, Jr. */ 81fad57d0eSMatthew Dillon int kern_execve(struct nlookupdata *nd, struct image_args *args); 822bd9d75cSDavid P. Reese, Jr. 832bd9d75cSDavid P. Reese, Jr. /* 849697c509SDavid P. Reese, Jr. * Prototypes for syscalls in kern/kern_exit.c 859697c509SDavid P. Reese, Jr. */ 869697c509SDavid P. Reese, Jr. int kern_wait(pid_t pid, int *status, int options, struct rusage *rusage, 879697c509SDavid P. Reese, Jr. int *res); 889697c509SDavid P. Reese, Jr. 899697c509SDavid P. Reese, Jr. /* 9065957d54SDavid P. Reese, Jr. * Prototypes for syscalls in kern/kern_sig.c 9165957d54SDavid P. Reese, Jr. */ 9265957d54SDavid P. Reese, Jr. int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact); 9365957d54SDavid P. Reese, Jr. int kern_sigprocmask(int how, struct __sigset *set, struct __sigset *oset); 9465957d54SDavid P. Reese, Jr. int kern_sigpending(struct __sigset *set); 9565957d54SDavid P. Reese, Jr. int kern_sigsuspend(struct __sigset *mask); 9665957d54SDavid P. Reese, Jr. int kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss); 97f9366a82SSimon Schubert int kern_kill(int sig, pid_t pid, lwpid_t tid); 9865957d54SDavid P. Reese, Jr. 9965957d54SDavid P. Reese, Jr. /* 100ba023347SDavid P. Reese, Jr. * Prototypes for syscalls in kern/sys_generic.c 101ba023347SDavid P. Reese, Jr. */ 102e54488bbSMatthew Dillon int kern_preadv(int fd, struct uio *auio, int flags, size_t *res); 103e54488bbSMatthew Dillon int kern_pwritev(int fd, struct uio *auio, int flags, size_t *res); 104ba023347SDavid P. Reese, Jr. 105ba023347SDavid P. Reese, Jr. /* 1069697c509SDavid P. Reese, Jr. * Prototypes for syscalls in kern/kern_resource.c 1079697c509SDavid P. Reese, Jr. */ 1089697c509SDavid P. Reese, Jr. int kern_setrlimit(u_int which, struct rlimit *limp); 1099697c509SDavid P. Reese, Jr. int kern_getrlimit(u_int which, struct rlimit *limp); 1109697c509SDavid P. Reese, Jr. 1119697c509SDavid P. Reese, Jr. /* 112ba023347SDavid P. Reese, Jr. * Prototypes for syscalls in kern/uipc_syscalls.c 113ba023347SDavid P. Reese, Jr. */ 114358e1f78SMatthew Dillon int kern_accept(int s, int fflags, struct sockaddr **name, int *namelen, int *res); 1155969a6f1SDavid P. Reese, Jr. int kern_bind(int s, struct sockaddr *sa); 116358e1f78SMatthew Dillon int kern_connect(int s, int fflags, struct sockaddr *sa); 1175969a6f1SDavid P. Reese, Jr. int kern_listen(int s, int backlog); 1185969a6f1SDavid P. Reese, Jr. int kern_getpeername(int s, struct sockaddr **name, int *namelen); 119201305adSDavid P. Reese, Jr. int kern_getsockopt(int s, struct sockopt *sopt); 1205969a6f1SDavid P. Reese, Jr. int kern_getsockname(int s, struct sockaddr **name, int *namelen); 1213e1837ceSDavid P. Reese, Jr. int kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio, 122e54488bbSMatthew Dillon struct mbuf **control, int *flags, size_t *res); 12375a872f8SDavid P. Reese, Jr. int kern_shutdown(int s, int how); 12475a872f8SDavid P. Reese, Jr. int kern_sendfile(struct vnode *vp, int s, off_t offset, size_t nbytes, 12530eeba44SJeffrey Hsu struct mbuf *mheader, off_t *sbytes, int flags); 1263e1837ceSDavid P. Reese, Jr. int kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio, 127e54488bbSMatthew Dillon struct mbuf *control, int flags, size_t *res); 128201305adSDavid P. Reese, Jr. int kern_setsockopt(int s, struct sockopt *sopt); 12975a872f8SDavid P. Reese, Jr. int kern_socket(int domain, int type, int protocol, int *res); 1305969a6f1SDavid P. Reese, Jr. int kern_socketpair(int domain, int type, int protocol, int *sockv); 1315969a6f1SDavid P. Reese, Jr. 1328f6f8622SDavid P. Reese, Jr. /* 1338f6f8622SDavid P. Reese, Jr. * Prototypes for syscalls in kern/vfs_syscalls.c 1348f6f8622SDavid P. Reese, Jr. */ 13518cf460bSNicolas Thery int kern_access(struct nlookupdata *nd, int amode, int flags); 13621739618SMatthew Dillon int kern_chdir(struct nlookupdata *nd); 137fad57d0eSMatthew Dillon int kern_chmod(struct nlookupdata *nd, int mode); 138fad57d0eSMatthew Dillon int kern_chown(struct nlookupdata *nd, int uid, int gid); 13928623bf9SMatthew Dillon int kern_chroot(struct nchandle *nch); 1409697c509SDavid P. Reese, Jr. int kern_fstatfs(int fd, struct statfs *buf); 141d9fad06eSMatthew Dillon int kern_fstatvfs(int fd, struct statvfs *buf); 1428f6f8622SDavid P. Reese, Jr. int kern_ftruncate(int fd, off_t length); 1439697c509SDavid P. Reese, Jr. int kern_futimes(int fd, struct timeval *tptr); 14453b02c48SJoerg Sonnenberger int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res, 14553b02c48SJoerg Sonnenberger enum uio_seg); 146fad57d0eSMatthew Dillon int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd); 1475a3fe67dSMatthew Dillon int kern_lseek(int fd, off_t offset, int whence, off_t *res); 1482281065eSMatthew Dillon int kern_mountctl(const char *path, int op, struct file *fp, 1492281065eSMatthew Dillon const void *ctl, int ctllen, 150949ecb9bSMatthew Dillon void *buf, int buflen, int *res); 151fad57d0eSMatthew Dillon int kern_mkdir(struct nlookupdata *nd, int mode); 152fad57d0eSMatthew Dillon int kern_mkfifo(struct nlookupdata *nd, int mode); 153b03976aeSSascha Wildner int kern_mknod(struct nlookupdata *nd, int mode, int rmajor, int rminor); 154fad57d0eSMatthew Dillon int kern_open(struct nlookupdata *nd, int flags, int mode, int *res); 15512693083SMatthew Dillon int kern_close(int fd); 1564336d5dfSJoerg Sonnenberger int kern_closefrom(int fd); 157fad57d0eSMatthew Dillon int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res); 158fad57d0eSMatthew Dillon int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond); 159fad57d0eSMatthew Dillon int kern_rmdir(struct nlookupdata *nd); 16021739618SMatthew Dillon int kern_stat(struct nlookupdata *nd, struct stat *st); 161fad57d0eSMatthew Dillon int kern_statfs(struct nlookupdata *nd, struct statfs *buf); 162d9fad06eSMatthew Dillon int kern_statvfs(struct nlookupdata *nd, struct statvfs *buf); 163fad57d0eSMatthew Dillon int kern_symlink(struct nlookupdata *nd, char *path, int mode); 164fad57d0eSMatthew Dillon int kern_truncate(struct nlookupdata *nd, off_t length); 165fad57d0eSMatthew Dillon int kern_unlink(struct nlookupdata *nd); 166fad57d0eSMatthew Dillon int kern_utimes(struct nlookupdata *nd, struct timeval *tptr); 167d7345b10SMatthew Dillon struct uuid *kern_uuidgen(struct uuid *store, size_t count); 1688f6f8622SDavid P. Reese, Jr. 169a0ff68c9SDavid P. Reese, Jr. /* 170b3ce8a64SMatthew Dillon * Prototypes for syscalls in kern/kern_time.c 171b3ce8a64SMatthew Dillon */ 172b3ce8a64SMatthew Dillon int kern_clock_gettime(clockid_t, struct timespec *); 173b3ce8a64SMatthew Dillon int kern_clock_settime(clockid_t, struct timespec *); 174b3ce8a64SMatthew Dillon int kern_clock_getres(clockid_t, struct timespec *); 175b3ce8a64SMatthew Dillon 176b3ce8a64SMatthew Dillon /* 17763f58b90SEirik Nygaard * Prototypes for syscalls in kern/vfs_cache.c 17863f58b90SEirik Nygaard */ 17902680f1bSMatthew Dillon char *kern_getcwd(char *, size_t, int *); 18063f58b90SEirik Nygaard 18163f58b90SEirik Nygaard /* 182a0ff68c9SDavid P. Reese, Jr. * Prototypes for syscalls in vm/vm_mmap.c 183a0ff68c9SDavid P. Reese, Jr. */ 184d3313941SMatthew Dillon int kern_mmap(struct vmspace *, caddr_t addr, size_t len, 185d3313941SMatthew Dillon int prot, int flags, int fd, off_t pos, void **res); 186a0ff68c9SDavid P. Reese, Jr. 1875969a6f1SDavid P. Reese, Jr. #endif /* !_SYS_KERN_SYSCALL_H_ */ 188