#ifndef _SYS_KERN_SYSCALL_H_
#define _SYS_KERN_SYSCALL_H_
#ifndef _KERNEL
#error "This file should not be included by userland programs."
#endif
#include <sys/signal.h>
#include <sys/wait.h>
#include <sys/_uio.h>
union fcntl_dat;
struct image_args;
struct plimit;
struct mbuf;
struct msghdr;
struct namecache;
struct nchandle;
struct nlookupdata;
struct rlimit;
struct rusage;
struct __wrusage;
struct sf_hdtr;
struct sockaddr;
struct socket;
struct sockopt;
struct stat;
struct statfs;
struct timeval;
struct uio;
struct vmspace;
struct vnode;
struct file;
struct ucred;
struct uuid;
struct statvfs;
int kern_dup(int flags, int old, int new, int *res);
int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred);
int kern_fstat(int fd, struct stat *st);
int kern_execve(struct nlookupdata *nd, struct file *fp, char fileflags,
struct image_args *args);
int kern_wait(idtype_t idtype, id_t id, int *status, int options,
struct __wrusage *wrusage, siginfo_t *info, int *res);
int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
int kern_sigprocmask(int how, sigset_t *set, sigset_t *oset);
int kern_sigpending(sigset_t *set);
int kern_sigsuspend(sigset_t *mask);
int kern_sigaltstack(stack_t *ss, stack_t *oss);
int kern_kill(int sig, pid_t pid, lwpid_t tid);
int kern_preadv(int fd, struct uio *auio, int flags, size_t *res);
int kern_pwritev(int fd, struct uio *auio, int flags, size_t *res);
int kern_setrlimit(u_int which, struct rlimit *limp);
int kern_getrlimit(u_int which, struct rlimit *limp);
int kern_accept(int s, int fflags, struct sockaddr **name, int *namelen, int *res,
int sockflags );
int kern_bind(int s, struct sockaddr *sa);
int kern_connect(int s, int fflags, struct sockaddr *sa);
int kern_listen(int s, int backlog);
int kern_getpeername(int s, struct sockaddr **name, int *namelen);
int kern_getsockopt(int s, struct sockopt *sopt);
int kern_getsockname(int s, struct sockaddr **name, int *namelen);
int kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio,
struct mbuf **control, int *flags, size_t *res);
int kern_shutdown(int s, int how);
int kern_sendfile(struct vnode *vp, int s, off_t offset, size_t nbytes,
struct mbuf *mheader, off_t *sbytes, int flags);
int kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio,
struct mbuf *control, int flags, size_t *res);
int kern_setsockopt(int s, struct sockopt *sopt);
int kern_socket(int domain, int type, int protocol, int *res);
int kern_socketpair(int domain, int type, int protocol, int *sockv);
int kern_pipe(long *fds, int flags);
int kern_access(struct nlookupdata *nd, int amode, int flags);
int kern_chdir(struct nlookupdata *nd);
int kern_chmod(struct nlookupdata *nd, int mode);
int kern_chown(struct nlookupdata *nd, int uid, int gid);
int kern_chroot(struct nchandle *nch);
int kern_fstatfs(int fd, struct statfs *buf);
int kern_fstatvfs(int fd, struct statvfs *buf);
int kern_ftruncate(int fd, off_t length);
int kern_futimens(int fd, struct timespec *ts);
int kern_futimes(int fd, struct timeval *tptr);
int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res,
enum uio_seg);
int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd);
int kern_lseek(int fd, off_t offset, int whence, off_t *res);
int kern_mountctl(const char *path, int op, struct file *fp,
const void *ctl, int ctllen,
void *buf, int buflen, int *res);
int kern_mkdir(struct nlookupdata *nd, int mode);
int kern_mkfifo(struct nlookupdata *nd, int mode);
int kern_mknod(struct nlookupdata *nd, int mode, int rmajor, int rminor);
int kern_open(struct nlookupdata *nd, int flags, int mode, int *res);
int kern_close(int fd);
int kern_closefrom(int fd);
int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res);
int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond);
int kern_rmdir(struct nlookupdata *nd);
int kern_stat(struct nlookupdata *nd, struct stat *st);
int kern_statfs(struct nlookupdata *nd, struct statfs *buf);
int kern_statvfs(struct nlookupdata *nd, struct statvfs *buf);
int kern_symlink(struct nlookupdata *nd, char *path, int mode);
int kern_truncate(struct nlookupdata *nd, off_t length);
int kern_unlink(struct nlookupdata *nd);
int kern_utimensat(struct nlookupdata *nd, const struct timespec *ts, int flag);
int kern_utimes(struct nlookupdata *nd, struct timeval *tptr);
struct uuid *kern_uuidgen(struct uuid *store, size_t count);
int kern_posix_fallocate(int fd, off_t offset, off_t len);
int kern_fsync(int fd, bool fullsync);
int kern_clock_gettime(clockid_t, struct timespec *);
int kern_clock_settime(clockid_t, struct timespec *);
int kern_clock_getres(clockid_t, struct timespec *);
char *kern_getcwd(char *, size_t, int *);
int kern_mmap(struct vmspace *, caddr_t addr, size_t len,
int prot, int flags, int fd, off_t pos, void **res);
#endif