xref: /dflybsd-src/sys/sys/kern_syscall.h (revision d7345b10d9624b5849a78c7fa1331ab235da70e9)
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*d7345b10SMatthew Dillon  * $DragonFly: src/sys/sys/kern_syscall.h,v 1.37 2007/06/16 19:57:08 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;
66*d7345b10SMatthew Dillon struct uuid;
675969a6f1SDavid P. Reese, Jr. 
68ba023347SDavid P. Reese, Jr. /*
69ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_descrip.c
70ba023347SDavid P. Reese, Jr.  */
71ba023347SDavid P. Reese, Jr. int kern_dup(enum dup_type type, int old, int new, int *res);
7287de5057SMatthew Dillon int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred);
738f6f8622SDavid P. Reese, Jr. int kern_fstat(int fd, struct stat *st);
74ba023347SDavid P. Reese, Jr. 
75ba023347SDavid P. Reese, Jr. /*
762bd9d75cSDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exec.c
772bd9d75cSDavid P. Reese, Jr.  */
78fad57d0eSMatthew Dillon int kern_execve(struct nlookupdata *nd, struct image_args *args);
792bd9d75cSDavid P. Reese, Jr. 
802bd9d75cSDavid P. Reese, Jr. /*
819697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exit.c
829697c509SDavid P. Reese, Jr.  */
839697c509SDavid P. Reese, Jr. int kern_wait(pid_t pid, int *status, int options, struct rusage *rusage,
849697c509SDavid P. Reese, Jr. 	int *res);
859697c509SDavid P. Reese, Jr. 
869697c509SDavid P. Reese, Jr. /*
8765957d54SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_sig.c
8865957d54SDavid P. Reese, Jr.  */
8965957d54SDavid P. Reese, Jr. int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
9065957d54SDavid P. Reese, Jr. int kern_sigprocmask(int how, struct __sigset *set, struct __sigset *oset);
9165957d54SDavid P. Reese, Jr. int kern_sigpending(struct __sigset *set);
9265957d54SDavid P. Reese, Jr. int kern_sigsuspend(struct __sigset *mask);
9365957d54SDavid P. Reese, Jr. int kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss);
94f9366a82SSimon Schubert int kern_kill(int sig, pid_t pid, lwpid_t tid);
9565957d54SDavid P. Reese, Jr. 
9665957d54SDavid P. Reese, Jr. /*
97ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/sys_generic.c
98ba023347SDavid P. Reese, Jr.  */
997f83ed38SMatthew Dillon int kern_preadv(int fd, struct uio *auio, int flags, int *res);
1007f83ed38SMatthew Dillon int kern_pwritev(int fd, struct uio *auio, int flags, int *res);
101ba023347SDavid P. Reese, Jr. 
102ba023347SDavid P. Reese, Jr. /*
1039697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_resource.c
1049697c509SDavid P. Reese, Jr.  */
1059697c509SDavid P. Reese, Jr. int kern_setrlimit(u_int which, struct rlimit *limp);
1069697c509SDavid P. Reese, Jr. int kern_getrlimit(u_int which, struct rlimit *limp);
1079697c509SDavid P. Reese, Jr. 
1089697c509SDavid P. Reese, Jr. /*
109ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/uipc_syscalls.c
110ba023347SDavid P. Reese, Jr.  */
111358e1f78SMatthew Dillon int kern_accept(int s, int fflags, struct sockaddr **name, int *namelen, int *res);
1125969a6f1SDavid P. Reese, Jr. int kern_bind(int s, struct sockaddr *sa);
113358e1f78SMatthew Dillon int kern_connect(int s, int fflags, struct sockaddr *sa);
1145969a6f1SDavid P. Reese, Jr. int kern_listen(int s, int backlog);
1155969a6f1SDavid P. Reese, Jr. int kern_getpeername(int s, struct sockaddr **name, int *namelen);
116201305adSDavid P. Reese, Jr. int kern_getsockopt(int s, struct sockopt *sopt);
1175969a6f1SDavid P. Reese, Jr. int kern_getsockname(int s, struct sockaddr **name, int *namelen);
1183e1837ceSDavid P. Reese, Jr. int kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio,
1193e1837ceSDavid P. Reese, Jr. 	struct mbuf **control, int *flags, int *res);
12075a872f8SDavid P. Reese, Jr. int kern_shutdown(int s, int how);
12175a872f8SDavid P. Reese, Jr. int kern_sendfile(struct vnode *vp, int s, off_t offset, size_t nbytes,
12230eeba44SJeffrey Hsu 	struct mbuf *mheader, off_t *sbytes, int flags);
1233e1837ceSDavid P. Reese, Jr. int kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio,
1243e1837ceSDavid P. Reese, Jr. 	struct mbuf *control, int flags, int *res);
125201305adSDavid P. Reese, Jr. int kern_setsockopt(int s, struct sockopt *sopt);
12675a872f8SDavid P. Reese, Jr. int kern_socket(int domain, int type, int protocol, int *res);
1275969a6f1SDavid P. Reese, Jr. int kern_socketpair(int domain, int type, int protocol, int *sockv);
1285969a6f1SDavid P. Reese, Jr. 
1298f6f8622SDavid P. Reese, Jr. /*
1308f6f8622SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/vfs_syscalls.c
1318f6f8622SDavid P. Reese, Jr.  */
132fad57d0eSMatthew Dillon int kern_access(struct nlookupdata *nd, int aflags);
13321739618SMatthew Dillon int kern_chdir(struct nlookupdata *nd);
134fad57d0eSMatthew Dillon int kern_chmod(struct nlookupdata *nd, int mode);
135fad57d0eSMatthew Dillon int kern_chown(struct nlookupdata *nd, int uid, int gid);
13628623bf9SMatthew Dillon int kern_chroot(struct nchandle *nch);
1379697c509SDavid P. Reese, Jr. int kern_fstatfs(int fd, struct statfs *buf);
1388f6f8622SDavid P. Reese, Jr. int kern_ftruncate(int fd, off_t length);
1399697c509SDavid P. Reese, Jr. int kern_futimes(int fd, struct timeval *tptr);
14053b02c48SJoerg Sonnenberger int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res,
14153b02c48SJoerg Sonnenberger 		       enum uio_seg);
142fad57d0eSMatthew Dillon int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd);
1435a3fe67dSMatthew Dillon int kern_lseek(int fd, off_t offset, int whence, off_t *res);
1442281065eSMatthew Dillon int kern_mountctl(const char *path, int op, struct file *fp,
1452281065eSMatthew Dillon 		const void *ctl, int ctllen,
146949ecb9bSMatthew Dillon                 void *buf, int buflen, int *res);
147fad57d0eSMatthew Dillon int kern_mkdir(struct nlookupdata *nd, int mode);
148fad57d0eSMatthew Dillon int kern_mkfifo(struct nlookupdata *nd, int mode);
1490e9b9130SMatthew Dillon int kern_mknod(struct nlookupdata *nd, int mode, int rmajor, int rminor);
150fad57d0eSMatthew Dillon int kern_open(struct nlookupdata *nd, int flags, int mode, int *res);
15112693083SMatthew Dillon int kern_close(int fd);
1524336d5dfSJoerg Sonnenberger int kern_closefrom(int fd);
153fad57d0eSMatthew Dillon int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res);
154fad57d0eSMatthew Dillon int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond);
155fad57d0eSMatthew Dillon int kern_rmdir(struct nlookupdata *nd);
15621739618SMatthew Dillon int kern_stat(struct nlookupdata *nd, struct stat *st);
157fad57d0eSMatthew Dillon int kern_statfs(struct nlookupdata *nd, struct statfs *buf);
158fad57d0eSMatthew Dillon int kern_symlink(struct nlookupdata *nd, char *path, int mode);
159fad57d0eSMatthew Dillon int kern_truncate(struct nlookupdata *nd, off_t length);
160fad57d0eSMatthew Dillon int kern_unlink(struct nlookupdata *nd);
161fad57d0eSMatthew Dillon int kern_utimes(struct nlookupdata *nd, struct timeval *tptr);
162*d7345b10SMatthew Dillon struct uuid *kern_uuidgen(struct uuid *store, size_t count);
1638f6f8622SDavid P. Reese, Jr. 
164a0ff68c9SDavid P. Reese, Jr. /*
16563f58b90SEirik Nygaard  * Prototypes for syscalls in kern/vfs_cache.c
16663f58b90SEirik Nygaard  */
16702680f1bSMatthew Dillon char *kern_getcwd(char *, size_t, int *);
16863f58b90SEirik Nygaard 
16963f58b90SEirik Nygaard /*
170a0ff68c9SDavid P. Reese, Jr.  * Prototypes for syscalls in vm/vm_mmap.c
171a0ff68c9SDavid P. Reese, Jr.  */
172d3313941SMatthew Dillon int kern_mmap(struct vmspace *, caddr_t addr, size_t len,
173d3313941SMatthew Dillon 	      int prot, int flags, int fd, off_t pos, void **res);
174a0ff68c9SDavid P. Reese, Jr. 
1755969a6f1SDavid P. Reese, Jr. #endif /* !_SYS_KERN_SYSCALL_H_ */
176