xref: /dflybsd-src/sys/sys/kern_syscall.h (revision c0b8a06dccf87f8888e7f60ab75cc38df3d74432)
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*c0b8a06dSMatthew Dillon  * $DragonFly: src/sys/sys/kern_syscall.h,v 1.31 2006/05/23 20:35:12 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;
43*c0b8a06dSMatthew Dillon struct plimit;
443e1837ceSDavid P. Reese, Jr. struct mbuf;
4535fbb1d9SDavid P. Reese, Jr. struct msghdr;
4621739618SMatthew Dillon struct namecache;
4721739618SMatthew Dillon struct nlookupdata;
489697c509SDavid P. Reese, Jr. struct rlimit;
499697c509SDavid P. Reese, Jr. struct rusage;
5065957d54SDavid P. Reese, Jr. struct sigaction;
5165957d54SDavid P. Reese, Jr. struct sigaltstack;
5265957d54SDavid P. Reese, Jr. struct __sigset;
5375a872f8SDavid P. Reese, Jr. struct sf_hdtr;
543e1837ceSDavid P. Reese, Jr. struct sockaddr;
5575a872f8SDavid P. Reese, Jr. struct socket;
56201305adSDavid P. Reese, Jr. struct sockopt;
5765957d54SDavid P. Reese, Jr. struct stat;
589697c509SDavid P. Reese, Jr. struct statfs;
599697c509SDavid P. Reese, Jr. struct timeval;
60ba023347SDavid P. Reese, Jr. struct uio;
6175a872f8SDavid P. Reese, Jr. struct vnode;
6282eaef15SMatthew Dillon struct file;
6387de5057SMatthew Dillon struct ucred;
645969a6f1SDavid P. Reese, Jr. 
65ba023347SDavid P. Reese, Jr. /*
66ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_descrip.c
67ba023347SDavid P. Reese, Jr.  */
68ba023347SDavid P. Reese, Jr. int kern_dup(enum dup_type type, int old, int new, int *res);
6987de5057SMatthew Dillon int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred);
708f6f8622SDavid P. Reese, Jr. int kern_fstat(int fd, struct stat *st);
71ba023347SDavid P. Reese, Jr. 
72ba023347SDavid P. Reese, Jr. /*
732bd9d75cSDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exec.c
742bd9d75cSDavid P. Reese, Jr.  */
75fad57d0eSMatthew Dillon int kern_execve(struct nlookupdata *nd, struct image_args *args);
762bd9d75cSDavid P. Reese, Jr. 
772bd9d75cSDavid P. Reese, Jr. /*
789697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exit.c
799697c509SDavid P. Reese, Jr.  */
809697c509SDavid P. Reese, Jr. int kern_wait(pid_t pid, int *status, int options, struct rusage *rusage,
819697c509SDavid P. Reese, Jr. 	int *res);
829697c509SDavid P. Reese, Jr. 
839697c509SDavid P. Reese, Jr. /*
8465957d54SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_sig.c
8565957d54SDavid P. Reese, Jr.  */
8665957d54SDavid P. Reese, Jr. int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
8765957d54SDavid P. Reese, Jr. int kern_sigprocmask(int how, struct __sigset *set, struct __sigset *oset);
8865957d54SDavid P. Reese, Jr. int kern_sigpending(struct __sigset *set);
8965957d54SDavid P. Reese, Jr. int kern_sigsuspend(struct __sigset *mask);
9065957d54SDavid P. Reese, Jr. int kern_sigaltstack(struct sigaltstack *ss, struct sigaltstack *oss);
9165957d54SDavid P. Reese, Jr. int kern_kill(int sig, int id);
9265957d54SDavid P. Reese, Jr. 
9365957d54SDavid P. Reese, Jr. /*
94ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/sys_generic.c
95ba023347SDavid P. Reese, Jr.  */
967f83ed38SMatthew Dillon int kern_preadv(int fd, struct uio *auio, int flags, int *res);
977f83ed38SMatthew Dillon int kern_pwritev(int fd, struct uio *auio, int flags, int *res);
98ba023347SDavid P. Reese, Jr. 
99ba023347SDavid P. Reese, Jr. /*
1009697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_resource.c
1019697c509SDavid P. Reese, Jr.  */
1029697c509SDavid P. Reese, Jr. int kern_setrlimit(u_int which, struct rlimit *limp);
1039697c509SDavid P. Reese, Jr. int kern_getrlimit(u_int which, struct rlimit *limp);
1049697c509SDavid P. Reese, Jr. 
1059697c509SDavid P. Reese, Jr. /*
106ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/uipc_syscalls.c
107ba023347SDavid P. Reese, Jr.  */
1085969a6f1SDavid P. Reese, Jr. int kern_accept(int s, struct sockaddr **name, int *namelen, int *res);
1095969a6f1SDavid P. Reese, Jr. int kern_bind(int s, struct sockaddr *sa);
1105969a6f1SDavid P. Reese, Jr. int kern_connect(int s, struct sockaddr *sa);
1115969a6f1SDavid P. Reese, Jr. int kern_listen(int s, int backlog);
1125969a6f1SDavid P. Reese, Jr. int kern_getpeername(int s, struct sockaddr **name, int *namelen);
113201305adSDavid P. Reese, Jr. int kern_getsockopt(int s, struct sockopt *sopt);
1145969a6f1SDavid P. Reese, Jr. int kern_getsockname(int s, struct sockaddr **name, int *namelen);
1153e1837ceSDavid P. Reese, Jr. int kern_recvmsg(int s, struct sockaddr **sa, struct uio *auio,
1163e1837ceSDavid P. Reese, Jr. 	struct mbuf **control, int *flags, int *res);
11775a872f8SDavid P. Reese, Jr. int kern_shutdown(int s, int how);
11875a872f8SDavid P. Reese, Jr. int kern_sendfile(struct vnode *vp, int s, off_t offset, size_t nbytes,
11930eeba44SJeffrey Hsu 	struct mbuf *mheader, off_t *sbytes, int flags);
1203e1837ceSDavid P. Reese, Jr. int kern_sendmsg(int s, struct sockaddr *sa, struct uio *auio,
1213e1837ceSDavid P. Reese, Jr. 	struct mbuf *control, int flags, int *res);
122201305adSDavid P. Reese, Jr. int kern_setsockopt(int s, struct sockopt *sopt);
12375a872f8SDavid P. Reese, Jr. int kern_socket(int domain, int type, int protocol, int *res);
1245969a6f1SDavid P. Reese, Jr. int kern_socketpair(int domain, int type, int protocol, int *sockv);
1255969a6f1SDavid P. Reese, Jr. 
1268f6f8622SDavid P. Reese, Jr. /*
1278f6f8622SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/vfs_syscalls.c
1288f6f8622SDavid P. Reese, Jr.  */
129fad57d0eSMatthew Dillon int kern_access(struct nlookupdata *nd, int aflags);
13021739618SMatthew Dillon int kern_chdir(struct nlookupdata *nd);
131fad57d0eSMatthew Dillon int kern_chmod(struct nlookupdata *nd, int mode);
132fad57d0eSMatthew Dillon int kern_chown(struct nlookupdata *nd, int uid, int gid);
13353dd6631SJoerg Sonnenberger int kern_chroot(struct namecache *ncp);
1349697c509SDavid P. Reese, Jr. int kern_fstatfs(int fd, struct statfs *buf);
1358f6f8622SDavid P. Reese, Jr. int kern_ftruncate(int fd, off_t length);
1369697c509SDavid P. Reese, Jr. int kern_futimes(int fd, struct timeval *tptr);
13753b02c48SJoerg Sonnenberger int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res,
13853b02c48SJoerg Sonnenberger 		       enum uio_seg);
139fad57d0eSMatthew Dillon int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd);
1405a3fe67dSMatthew Dillon int kern_lseek(int fd, off_t offset, int whence, off_t *res);
1412281065eSMatthew Dillon int kern_mountctl(const char *path, int op, struct file *fp,
1422281065eSMatthew Dillon 		const void *ctl, int ctllen,
143949ecb9bSMatthew Dillon                 void *buf, int buflen, int *res);
144fad57d0eSMatthew Dillon int kern_mkdir(struct nlookupdata *nd, int mode);
145fad57d0eSMatthew Dillon int kern_mkfifo(struct nlookupdata *nd, int mode);
146fad57d0eSMatthew Dillon int kern_mknod(struct nlookupdata *nd, int mode, int dev);
147fad57d0eSMatthew Dillon int kern_open(struct nlookupdata *nd, int flags, int mode, int *res);
14812693083SMatthew Dillon int kern_close(int fd);
1494336d5dfSJoerg Sonnenberger int kern_closefrom(int fd);
150fad57d0eSMatthew Dillon int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res);
151fad57d0eSMatthew Dillon int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond);
152fad57d0eSMatthew Dillon int kern_rmdir(struct nlookupdata *nd);
15321739618SMatthew Dillon int kern_stat(struct nlookupdata *nd, struct stat *st);
154fad57d0eSMatthew Dillon int kern_statfs(struct nlookupdata *nd, struct statfs *buf);
155fad57d0eSMatthew Dillon int kern_symlink(struct nlookupdata *nd, char *path, int mode);
156fad57d0eSMatthew Dillon int kern_truncate(struct nlookupdata *nd, off_t length);
157fad57d0eSMatthew Dillon int kern_unlink(struct nlookupdata *nd);
158fad57d0eSMatthew Dillon int kern_utimes(struct nlookupdata *nd, struct timeval *tptr);
1598f6f8622SDavid P. Reese, Jr. 
160a0ff68c9SDavid P. Reese, Jr. /*
16163f58b90SEirik Nygaard  * Prototypes for syscalls in kern/vfs_cache.c
16263f58b90SEirik Nygaard  */
16302680f1bSMatthew Dillon char *kern_getcwd(char *, size_t, int *);
16463f58b90SEirik Nygaard 
16563f58b90SEirik Nygaard /*
166a0ff68c9SDavid P. Reese, Jr.  * Prototypes for syscalls in vm/vm_mmap.c
167a0ff68c9SDavid P. Reese, Jr.  */
168a0ff68c9SDavid P. Reese, Jr. int kern_mmap(caddr_t addr, size_t len, int prot, int flags, int fd,
169a0ff68c9SDavid P. Reese, Jr. 	off_t pos, void **res);
170a0ff68c9SDavid P. Reese, Jr. 
1715969a6f1SDavid P. Reese, Jr. #endif /* !_SYS_KERN_SYSCALL_H_ */
172