xref: /dflybsd-src/sys/sys/kern_syscall.h (revision 74fa2560ac77f9db4a34b2a7c72450126fec4ed6)
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.  */
285969a6f1SDavid P. Reese, Jr. 
295969a6f1SDavid P. Reese, Jr. #ifndef _SYS_KERN_SYSCALL_H_
305969a6f1SDavid P. Reese, Jr. #define _SYS_KERN_SYSCALL_H_
315969a6f1SDavid P. Reese, Jr. 
32d9f3f6faSChris Pressey #ifndef _KERNEL
33d9f3f6faSChris Pressey #error "This file should not be included by userland programs."
34d9f3f6faSChris Pressey #endif
35d9f3f6faSChris Pressey 
367bc469f6SSascha Wildner #include <sys/signal.h>
3733b81dc9SMatthew Dillon #include <sys/wait.h>
3813dd34d8Szrj #include <sys/_uio.h>
3953b02c48SJoerg Sonnenberger 
40dda4b42bSDavid P. Reese, Jr. union fcntl_dat;
412bd9d75cSDavid P. Reese, Jr. struct image_args;
42c0b8a06dSMatthew Dillon struct plimit;
433e1837ceSDavid P. Reese, Jr. struct mbuf;
4435fbb1d9SDavid P. Reese, Jr. struct msghdr;
4521739618SMatthew Dillon struct namecache;
4628623bf9SMatthew Dillon struct nchandle;
4721739618SMatthew Dillon struct nlookupdata;
489697c509SDavid P. Reese, Jr. struct rlimit;
499697c509SDavid P. Reese, Jr. struct rusage;
5033b81dc9SMatthew Dillon struct __wrusage;
5175a872f8SDavid P. Reese, Jr. struct sf_hdtr;
523e1837ceSDavid P. Reese, Jr. struct sockaddr;
5375a872f8SDavid P. Reese, Jr. struct socket;
54201305adSDavid P. Reese, Jr. struct sockopt;
5565957d54SDavid P. Reese, Jr. struct stat;
569697c509SDavid P. Reese, Jr. struct statfs;
579697c509SDavid P. Reese, Jr. struct timeval;
58ba023347SDavid P. Reese, Jr. struct uio;
59d3313941SMatthew Dillon struct vmspace;
6075a872f8SDavid P. Reese, Jr. struct vnode;
6182eaef15SMatthew Dillon struct file;
6287de5057SMatthew Dillon struct ucred;
63d7345b10SMatthew Dillon struct uuid;
64d9fad06eSMatthew Dillon struct statvfs;
655969a6f1SDavid P. Reese, Jr. 
66ba023347SDavid P. Reese, Jr. /*
67ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_descrip.c
68ba023347SDavid P. Reese, Jr.  */
69a2988f1bSJohn Marino int kern_dup(int flags, int old, int new, int *res);
7087de5057SMatthew Dillon int kern_fcntl(int fd, int cmd, union fcntl_dat *dat, struct ucred *cred);
718f6f8622SDavid P. Reese, Jr. int kern_fstat(int fd, struct stat *st);
72ba023347SDavid P. Reese, Jr. 
73ba023347SDavid P. Reese, Jr. /*
742bd9d75cSDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exec.c
752bd9d75cSDavid P. Reese, Jr.  */
76941642e8SAaron LI int kern_execve(struct nlookupdata *nd, struct file *fp, char fileflags,
77337acc44SAaron LI 		struct image_args *args);
782bd9d75cSDavid P. Reese, Jr. 
792bd9d75cSDavid P. Reese, Jr. /*
809697c509SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_exit.c
819697c509SDavid P. Reese, Jr.  */
8233b81dc9SMatthew Dillon int kern_wait(idtype_t idtype, id_t id, int *status, int options,
837bc469f6SSascha Wildner 	struct __wrusage *wrusage, siginfo_t *info, int *res);
849697c509SDavid P. Reese, Jr. 
859697c509SDavid P. Reese, Jr. /*
8665957d54SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/kern_sig.c
8765957d54SDavid P. Reese, Jr.  */
8865957d54SDavid P. Reese, Jr. int kern_sigaction(int sig, struct sigaction *act, struct sigaction *oact);
897bc469f6SSascha Wildner int kern_sigprocmask(int how, sigset_t *set, sigset_t *oset);
907bc469f6SSascha Wildner int kern_sigpending(sigset_t *set);
917bc469f6SSascha Wildner int kern_sigsuspend(sigset_t *mask);
927bc469f6SSascha Wildner int kern_sigaltstack(stack_t *ss, stack_t *oss);
93f9366a82SSimon Schubert int kern_kill(int sig, pid_t pid, lwpid_t tid);
9465957d54SDavid P. Reese, Jr. 
9565957d54SDavid P. Reese, Jr. /*
96ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/sys_generic.c
97ba023347SDavid P. Reese, Jr.  */
98e54488bbSMatthew Dillon int kern_preadv(int fd, struct uio *auio, int flags, size_t *res);
99e54488bbSMatthew Dillon int kern_pwritev(int fd, struct uio *auio, int flags, size_t *res);
100ba023347SDavid P. Reese, Jr. 
101ba023347SDavid P. Reese, Jr. /*
10299db3688SSascha Wildner  * Prototypes for syscalls in kern/kern_plimit.c
1039697c509SDavid P. Reese, Jr.  */
1049697c509SDavid P. Reese, Jr. int kern_setrlimit(u_int which, struct rlimit *limp);
1059697c509SDavid P. Reese, Jr. int kern_getrlimit(u_int which, struct rlimit *limp);
1069697c509SDavid P. Reese, Jr. 
1079697c509SDavid P. Reese, Jr. /*
108ba023347SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/uipc_syscalls.c
109ba023347SDavid P. Reese, Jr.  */
11073610d44SSepherosa Ziehau int kern_accept(int s, int fflags, struct sockaddr **name, int *namelen, int *res,
11173610d44SSepherosa Ziehau 	int sockflags /* SOCK_{NONBLOCK,CLOEXEC,KERN_NOINHERIT} */);
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,
119e54488bbSMatthew Dillon 	struct mbuf **control, int *flags, size_t *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,
124e54488bbSMatthew Dillon 	struct mbuf *control, int flags, size_t *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. /*
130ca1161c6SMatthew Dillon  * Prototypes for syscalls in kern/sys_pipe.c
131ca1161c6SMatthew Dillon  */
132ca1161c6SMatthew Dillon int kern_pipe(long *fds, int flags);
133ca1161c6SMatthew Dillon 
134ca1161c6SMatthew Dillon /*
1358f6f8622SDavid P. Reese, Jr.  * Prototypes for syscalls in kern/vfs_syscalls.c
1368f6f8622SDavid P. Reese, Jr.  */
13718cf460bSNicolas Thery int kern_access(struct nlookupdata *nd, int amode, int flags);
13821739618SMatthew Dillon int kern_chdir(struct nlookupdata *nd);
139fad57d0eSMatthew Dillon int kern_chmod(struct nlookupdata *nd, int mode);
140fad57d0eSMatthew Dillon int kern_chown(struct nlookupdata *nd, int uid, int gid);
14128623bf9SMatthew Dillon int kern_chroot(struct nchandle *nch);
1429697c509SDavid P. Reese, Jr. int kern_fstatfs(int fd, struct statfs *buf);
143d9fad06eSMatthew Dillon int kern_fstatvfs(int fd, struct statvfs *buf);
1448f6f8622SDavid P. Reese, Jr. int kern_ftruncate(int fd, off_t length);
1458edf56c9SMatthew Dillon int kern_futimens(int fd, struct timespec *ts);
1469697c509SDavid P. Reese, Jr. int kern_futimes(int fd, struct timeval *tptr);
14753b02c48SJoerg Sonnenberger int kern_getdirentries(int fd, char *buf, u_int count, long *basep, int *res,
14853b02c48SJoerg Sonnenberger 		       enum uio_seg);
149fad57d0eSMatthew Dillon int kern_link(struct nlookupdata *nd, struct nlookupdata *linknd);
1505a3fe67dSMatthew Dillon int kern_lseek(int fd, off_t offset, int whence, off_t *res);
1512281065eSMatthew Dillon int kern_mountctl(const char *path, int op, struct file *fp,
1522281065eSMatthew Dillon 		const void *ctl, int ctllen,
153949ecb9bSMatthew Dillon                 void *buf, int buflen, int *res);
154fad57d0eSMatthew Dillon int kern_mkdir(struct nlookupdata *nd, int mode);
155fad57d0eSMatthew Dillon int kern_mkfifo(struct nlookupdata *nd, int mode);
156b03976aeSSascha Wildner int kern_mknod(struct nlookupdata *nd, int mode, int rmajor, int rminor);
157fad57d0eSMatthew Dillon int kern_open(struct nlookupdata *nd, int flags, int mode, int *res);
15812693083SMatthew Dillon int kern_close(int fd);
1594336d5dfSJoerg Sonnenberger int kern_closefrom(int fd);
160fad57d0eSMatthew Dillon int kern_readlink(struct nlookupdata *nd, char *buf, int count, int *res);
161fad57d0eSMatthew Dillon int kern_rename(struct nlookupdata *fromnd, struct nlookupdata *tond);
162fad57d0eSMatthew Dillon int kern_rmdir(struct nlookupdata *nd);
16321739618SMatthew Dillon int kern_stat(struct nlookupdata *nd, struct stat *st);
164fad57d0eSMatthew Dillon int kern_statfs(struct nlookupdata *nd, struct statfs *buf);
165d9fad06eSMatthew Dillon int kern_statvfs(struct nlookupdata *nd, struct statvfs *buf);
166fad57d0eSMatthew Dillon int kern_symlink(struct nlookupdata *nd, char *path, int mode);
167fad57d0eSMatthew Dillon int kern_truncate(struct nlookupdata *nd, off_t length);
168fad57d0eSMatthew Dillon int kern_unlink(struct nlookupdata *nd);
169f34e9020SMatthew Dillon int kern_utimensat(struct nlookupdata *nd, const struct timespec *ts, int flag);
170fad57d0eSMatthew Dillon int kern_utimes(struct nlookupdata *nd, struct timeval *tptr);
171d7345b10SMatthew Dillon struct uuid *kern_uuidgen(struct uuid *store, size_t count);
17209d96b9cSTomohiro Kusumi int kern_posix_fallocate(int fd, off_t offset, off_t len);
173*74fa2560STomohiro Kusumi int kern_fsync(int fd, bool fullsync);
1748f6f8622SDavid P. Reese, Jr. 
175a0ff68c9SDavid P. Reese, Jr. /*
176b3ce8a64SMatthew Dillon  * Prototypes for syscalls in kern/kern_time.c
177b3ce8a64SMatthew Dillon  */
178b3ce8a64SMatthew Dillon int kern_clock_gettime(clockid_t, struct timespec *);
179b3ce8a64SMatthew Dillon int kern_clock_settime(clockid_t, struct timespec *);
180b3ce8a64SMatthew Dillon int kern_clock_getres(clockid_t, struct timespec *);
181b3ce8a64SMatthew Dillon 
182b3ce8a64SMatthew Dillon /*
18363f58b90SEirik Nygaard  * Prototypes for syscalls in kern/vfs_cache.c
18463f58b90SEirik Nygaard  */
18502680f1bSMatthew Dillon char *kern_getcwd(char *, size_t, int *);
18663f58b90SEirik Nygaard 
18763f58b90SEirik Nygaard /*
188a0ff68c9SDavid P. Reese, Jr.  * Prototypes for syscalls in vm/vm_mmap.c
189a0ff68c9SDavid P. Reese, Jr.  */
190d3313941SMatthew Dillon int kern_mmap(struct vmspace *, caddr_t addr, size_t len,
191d3313941SMatthew Dillon 	      int prot, int flags, int fd, off_t pos, void **res);
192a0ff68c9SDavid P. Reese, Jr. 
1935969a6f1SDavid P. Reese, Jr. #endif /* !_SYS_KERN_SYSCALL_H_ */
194