xref: /dflybsd-src/sys/sys/kern_syscall.h (revision d9fad06efb17ebed7dc91f2c8ed986184e89e0a1)
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.  *
28*d9fad06eSMatthew 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 
40dda4b42bSDavid P. Reese, Jr. enum dup_type {DUP_FIXED, DUP_VARIABLE};
41dda4b42bSDavid P. Reese, Jr. union fcntl_dat;
422bd9d75cSDavid P. Reese, Jr. struct image_args;
43c0b8a06dSMatthew Dillon struct plimit;
443e1837ceSDavid P. Reese, Jr. struct mbuf;
4535fbb1d9SDavid P. Reese, Jr. struct msghdr;
4621739618SMatthew Dillon struct namecache;
4728623bf9SMatthew Dillon struct nchandle;
4821739618SMatthew Dillon struct nlookupdata;
499697c509SDavid P. Reese, Jr. struct rlimit;
509697c509SDavid P. Reese, Jr. struct rusage;
5165957d54SDavid P. Reese, Jr. struct sigaction;
5265957d54SDavid P. Reese, Jr. struct sigaltstack;
5365957d54SDavid P. Reese, Jr. struct __sigset;
5475a872f8SDavid P. Reese, Jr. struct sf_hdtr;
553e1837ceSDavid P. Reese, Jr. struct sockaddr;
5675a872f8SDavid P. Reese, Jr. struct socket;
57201305adSDavid P. Reese, Jr. struct sockopt;
5865957d54SDavid P. Reese, Jr. struct stat;
599697c509SDavid P. Reese, Jr. struct statfs;
609697c509SDavid P. Reese, Jr. struct timeval;
61ba023347SDavid P. Reese, Jr. struct uio;
62d3313941SMatthew Dillon struct vmspace;
6375a872f8SDavid P. Reese, Jr. struct vnode;
6482eaef15SMatthew Dillon struct file;
6587de5057SMatthew Dillon struct ucred;
66d7345b10SMatthew Dillon struct uuid;
67*d9fad06eSMatthew Dillon struct statvfs;
685969a6f1SDavid P. Reese, Jr. 
69ba023347SDavid P. Reese, Jr. /*
70ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_descrip.c
71ba023347SDavid P. Reese, Jr.  */
72ba023347SDavid P. Reese, Jr. int kern_dup(enum dup_type type, int old, int new, int *res);
7387de5057SMatthew Dillon int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred);
748f6f8622SDavid P. Reese, Jr. int kern_fstat(int fd, struct stat *st);
75ba023347SDavid P. Reese, Jr. 
76ba023347SDavid P. Reese, Jr. /*
772bd9d75cSDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exec.c
782bd9d75cSDavid P. Reese, Jr.  */
79fad57d0eSMatthew Dillon int kern_execve(struct nlookupdata *nd, struct image_args *args);
802bd9d75cSDavid P. Reese, Jr. 
812bd9d75cSDavid P. Reese, Jr. /*
829697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exit.c
839697c509SDavid P. Reese, Jr.  */
849697c509SDavid P. Reese, Jr. int kern_wait(pid_t pid, int *status, int options, struct rusage *rusage,
859697c509SDavid P. Reese, Jr. 	int *res);
869697c509SDavid P. Reese, Jr. 
879697c509SDavid P. Reese, Jr. /*
8865957d54SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_sig.c
8965957d54SDavid P. Reese, Jr.  */
9065957d54SDavid P. Reese, Jr. int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
9165957d54SDavid P. Reese, Jr. int kern_sigprocmask(int how, struct __sigset *set, struct __sigset *oset);
9265957d54SDavid P. Reese, Jr. int kern_sigpending(struct __sigset *set);
9365957d54SDavid P. Reese, Jr. int kern_sigsuspend(struct __sigset *mask);
9465957d54SDavid P. Reese, Jr. int kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss);
95f9366a82SSimon Schubert int kern_kill(int sig, pid_t pid, lwpid_t tid);
9665957d54SDavid P. Reese, Jr. 
9765957d54SDavid P. Reese, Jr. /*
98ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/sys_generic.c
99ba023347SDavid P. Reese, Jr.  */
1007f83ed38SMatthew Dillon int kern_preadv(int fd, struct uio *auio, int flags, int *res);
1017f83ed38SMatthew Dillon int kern_pwritev(int fd, struct uio *auio, int flags, int *res);
102ba023347SDavid P. Reese, Jr. 
103ba023347SDavid P. Reese, Jr. /*
1049697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_resource.c
1059697c509SDavid P. Reese, Jr.  */
1069697c509SDavid P. Reese, Jr. int kern_setrlimit(u_int which, struct rlimit *limp);
1079697c509SDavid P. Reese, Jr. int kern_getrlimit(u_int which, struct rlimit *limp);
1089697c509SDavid P. Reese, Jr. 
1099697c509SDavid P. Reese, Jr. /*
110ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/uipc_syscalls.c
111ba023347SDavid P. Reese, Jr.  */
112358e1f78SMatthew Dillon int kern_accept(int s, int fflags, struct sockaddr **name, int *namelen, int *res);
1135969a6f1SDavid P. Reese, Jr. int kern_bind(int s, struct sockaddr *sa);
114358e1f78SMatthew Dillon int kern_connect(int s, int fflags, struct sockaddr *sa);
1155969a6f1SDavid P. Reese, Jr. int kern_listen(int s, int backlog);
1165969a6f1SDavid P. Reese, Jr. int kern_getpeername(int s, struct sockaddr **name, int *namelen);
117201305adSDavid P. Reese, Jr. int kern_getsockopt(int s, struct sockopt *sopt);
1185969a6f1SDavid P. Reese, Jr. int kern_getsockname(int s, struct sockaddr **name, int *namelen);
1193e1837ceSDavid P. Reese, Jr. int kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio,
1203e1837ceSDavid P. Reese, Jr. 	struct mbuf **control, int *flags, int *res);
12175a872f8SDavid P. Reese, Jr. int kern_shutdown(int s, int how);
12275a872f8SDavid P. Reese, Jr. int kern_sendfile(struct vnode *vp, int s, off_t offset, size_t nbytes,
12330eeba44SJeffrey Hsu 	struct mbuf *mheader, off_t *sbytes, int flags);
1243e1837ceSDavid P. Reese, Jr. int kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio,
1253e1837ceSDavid P. Reese, Jr. 	struct mbuf *control, int flags, int *res);
126201305adSDavid P. Reese, Jr. int kern_setsockopt(int s, struct sockopt *sopt);
12775a872f8SDavid P. Reese, Jr. int kern_socket(int domain, int type, int protocol, int *res);
1285969a6f1SDavid P. Reese, Jr. int kern_socketpair(int domain, int type, int protocol, int *sockv);
1295969a6f1SDavid P. Reese, Jr. 
1308f6f8622SDavid P. Reese, Jr. /*
1318f6f8622SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/vfs_syscalls.c
1328f6f8622SDavid P. Reese, Jr.  */
133fad57d0eSMatthew Dillon int kern_access(struct nlookupdata *nd, int aflags);
13421739618SMatthew Dillon int kern_chdir(struct nlookupdata *nd);
135fad57d0eSMatthew Dillon int kern_chmod(struct nlookupdata *nd, int mode);
136fad57d0eSMatthew Dillon int kern_chown(struct nlookupdata *nd, int uid, int gid);
13728623bf9SMatthew Dillon int kern_chroot(struct nchandle *nch);
1389697c509SDavid P. Reese, Jr. int kern_fstatfs(int fd, struct statfs *buf);
139*d9fad06eSMatthew Dillon int kern_fstatvfs(int fd, struct statvfs *buf);
1408f6f8622SDavid P. Reese, Jr. int kern_ftruncate(int fd, off_t length);
1419697c509SDavid P. Reese, Jr. int kern_futimes(int fd, struct timeval *tptr);
14253b02c48SJoerg Sonnenberger int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res,
14353b02c48SJoerg Sonnenberger 		       enum uio_seg);
144fad57d0eSMatthew Dillon int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd);
1455a3fe67dSMatthew Dillon int kern_lseek(int fd, off_t offset, int whence, off_t *res);
1462281065eSMatthew Dillon int kern_mountctl(const char *path, int op, struct file *fp,
1472281065eSMatthew Dillon 		const void *ctl, int ctllen,
148949ecb9bSMatthew Dillon                 void *buf, int buflen, int *res);
149fad57d0eSMatthew Dillon int kern_mkdir(struct nlookupdata *nd, int mode);
150fad57d0eSMatthew Dillon int kern_mkfifo(struct nlookupdata *nd, int mode);
1510e9b9130SMatthew Dillon int kern_mknod(struct nlookupdata *nd, int mode, int rmajor, int rminor);
152fad57d0eSMatthew Dillon int kern_open(struct nlookupdata *nd, int flags, int mode, int *res);
15312693083SMatthew Dillon int kern_close(int fd);
1544336d5dfSJoerg Sonnenberger int kern_closefrom(int fd);
155fad57d0eSMatthew Dillon int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res);
156fad57d0eSMatthew Dillon int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond);
157fad57d0eSMatthew Dillon int kern_rmdir(struct nlookupdata *nd);
15821739618SMatthew Dillon int kern_stat(struct nlookupdata *nd, struct stat *st);
159fad57d0eSMatthew Dillon int kern_statfs(struct nlookupdata *nd, struct statfs *buf);
160*d9fad06eSMatthew Dillon int kern_statvfs(struct nlookupdata *nd, struct statvfs *buf);
161fad57d0eSMatthew Dillon int kern_symlink(struct nlookupdata *nd, char *path, int mode);
162fad57d0eSMatthew Dillon int kern_truncate(struct nlookupdata *nd, off_t length);
163fad57d0eSMatthew Dillon int kern_unlink(struct nlookupdata *nd);
164fad57d0eSMatthew Dillon int kern_utimes(struct nlookupdata *nd, struct timeval *tptr);
165d7345b10SMatthew Dillon struct uuid *kern_uuidgen(struct uuid *store, size_t count);
1668f6f8622SDavid P. Reese, Jr. 
167a0ff68c9SDavid P. Reese, Jr. /*
16863f58b90SEirik Nygaard  * Prototypes for syscalls in kern/vfs_cache.c
16963f58b90SEirik Nygaard  */
17002680f1bSMatthew Dillon char *kern_getcwd(char *, size_t, int *);
17163f58b90SEirik Nygaard 
17263f58b90SEirik Nygaard /*
173a0ff68c9SDavid P. Reese, Jr.  * Prototypes for syscalls in vm/vm_mmap.c
174a0ff68c9SDavid P. Reese, Jr.  */
175d3313941SMatthew Dillon int kern_mmap(struct vmspace *, caddr_t addr, size_t len,
176d3313941SMatthew Dillon 	      int prot, int flags, int fd, off_t pos, void **res);
177a0ff68c9SDavid P. Reese, Jr. 
1785969a6f1SDavid P. Reese, Jr. #endif /* !_SYS_KERN_SYSCALL_H_ */
179