160727d8bSWarner Losh /*- 28f19eb88SIan Dowse * Copyright (c) 2002 Ian Dowse. All rights reserved. 38f19eb88SIan Dowse * 48f19eb88SIan Dowse * Redistribution and use in source and binary forms, with or without 58f19eb88SIan Dowse * modification, are permitted provided that the following conditions 68f19eb88SIan Dowse * are met: 78f19eb88SIan Dowse * 1. Redistributions of source code must retain the above copyright 88f19eb88SIan Dowse * notice, this list of conditions and the following disclaimer. 98f19eb88SIan Dowse * 2. Redistributions in binary form must reproduce the above copyright 108f19eb88SIan Dowse * notice, this list of conditions and the following disclaimer in the 118f19eb88SIan Dowse * documentation and/or other materials provided with the distribution. 128f19eb88SIan Dowse * 138f19eb88SIan Dowse * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 148f19eb88SIan Dowse * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 158f19eb88SIan Dowse * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 168f19eb88SIan Dowse * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 178f19eb88SIan Dowse * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 188f19eb88SIan Dowse * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 198f19eb88SIan Dowse * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 208f19eb88SIan Dowse * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 218f19eb88SIan Dowse * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 228f19eb88SIan Dowse * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 238f19eb88SIan Dowse * SUCH DAMAGE. 248f19eb88SIan Dowse * 258f19eb88SIan Dowse * $FreeBSD$ 268f19eb88SIan Dowse */ 278f19eb88SIan Dowse 288f19eb88SIan Dowse #ifndef _SYS_SYSCALLSUBR_H_ 298f19eb88SIan Dowse #define _SYS_SYSCALLSUBR_H_ 308f19eb88SIan Dowse 318f19eb88SIan Dowse #include <sys/signal.h> 328f19eb88SIan Dowse #include <sys/uio.h> 33e140eb43SDavid Malone #include <sys/socket.h> 3484e0b075SDavid Xu #include <sys/mac.h> 3576951d21SJohn Baldwin #include <sys/mount.h> 368f19eb88SIan Dowse 3776951d21SJohn Baldwin struct itimerval; 3876951d21SJohn Baldwin struct image_args; 39710c5645SDavid Malone struct mbuf; 408914e6f4SJohn Baldwin struct msghdr; 4176951d21SJohn Baldwin struct msqid_ds; 42c8837938SJohn Baldwin struct rlimit; 4378c85e8dSJohn Baldwin struct rusage; 448914e6f4SJohn Baldwin struct sockaddr; 4576951d21SJohn Baldwin struct stat; 46c1aa81b6SPaul Saab struct kevent; 4712e4397eSHajimu UMEMOTO 4848b52b7aSIan Dowse int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, 4948b52b7aSIan Dowse u_int buflen); 508f19eb88SIan Dowse int kern_access(struct thread *td, char *path, enum uio_seg pathseg, 518f19eb88SIan Dowse int flags); 52*b88ec951SJohn Baldwin int kern_adjtime(struct thread *td, struct timeval *delta, 53*b88ec951SJohn Baldwin struct timeval *olddelta); 5476951d21SJohn Baldwin int kern_alternate_path(struct thread *td, const char *prefix, char *path, 5576951d21SJohn Baldwin enum uio_seg pathseg, char **pathbuf, int create); 5612e4397eSHajimu UMEMOTO int kern_bind(struct thread *td, int fd, struct sockaddr *sa); 578f19eb88SIan Dowse int kern_chdir(struct thread *td, char *path, enum uio_seg pathseg); 588f19eb88SIan Dowse int kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, 598f19eb88SIan Dowse int mode); 608f19eb88SIan Dowse int kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid, 618f19eb88SIan Dowse int gid); 6212e4397eSHajimu UMEMOTO int kern_connect(struct thread *td, int fd, struct sockaddr *sa); 63610ecfe0SMaxim Sobolev int kern_execve(struct thread *td, struct image_args *args, 64c8837938SJohn Baldwin struct mac *mac_p); 6549c2ff15SIan Dowse int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); 6676951d21SJohn Baldwin int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); 6776951d21SJohn Baldwin int kern_fstat(struct thread *td, int fd, struct stat *sbp); 6876951d21SJohn Baldwin int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); 698f19eb88SIan Dowse int kern_futimes(struct thread *td, int fd, struct timeval *tptr, 708f19eb88SIan Dowse enum uio_seg tptrseg); 7123af91dcSMaxim Sobolev int kern_getitimer(struct thread *, u_int, struct itimerval *); 7278c85e8dSJohn Baldwin int kern_getrusage(struct thread *td, int who, struct rusage *rup); 73e140eb43SDavid Malone int kern_getsockopt(struct thread *td, int s, int level, int name, 74e140eb43SDavid Malone void *optval, enum uio_seg valseg, socklen_t *valsize); 75c1aa81b6SPaul Saab int kern_kevent(struct thread *td, int fd, struct kevent *changelist, 76c1aa81b6SPaul Saab int nchanges, enum uio_seg changeseg, struct kevent *eventlist, 77c1aa81b6SPaul Saab int nevents, enum uio_seg eventseg, const struct timespec *timeout); 788f19eb88SIan Dowse int kern_lchown(struct thread *td, char *path, enum uio_seg pathseg, 798f19eb88SIan Dowse int uid, int gid); 808f19eb88SIan Dowse int kern_link(struct thread *td, char *path, char *link, 818f19eb88SIan Dowse enum uio_seg segflg); 8276951d21SJohn Baldwin int kern_lstat(struct thread *td, char *path, enum uio_seg pathseg, 8376951d21SJohn Baldwin struct stat *sbp); 848f19eb88SIan Dowse int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, 858f19eb88SIan Dowse struct timeval *tptr, enum uio_seg tptrseg); 868f19eb88SIan Dowse int kern_mkdir(struct thread *td, char *path, enum uio_seg segflg, 878f19eb88SIan Dowse int mode); 888f19eb88SIan Dowse int kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg, 898f19eb88SIan Dowse int mode); 908f19eb88SIan Dowse int kern_mknod(struct thread *td, char *path, enum uio_seg pathseg, 918f19eb88SIan Dowse int mode, int dev); 9276951d21SJohn Baldwin int kern_msgctl(struct thread *, int, int, struct msqid_ds *); 93efa42cbcSPaul Saab int kern_nanosleep(struct thread *td, struct timespec *rqt, 94efa42cbcSPaul Saab struct timespec *rmt); 958f19eb88SIan Dowse int kern_open(struct thread *td, char *path, enum uio_seg pathseg, 968f19eb88SIan Dowse int flags, int mode); 97fee4a6afSJohn Baldwin int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, 98fee4a6afSJohn Baldwin int name); 99012e544fSIan Dowse int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, 100012e544fSIan Dowse int data); 1018f19eb88SIan Dowse int kern_readlink(struct thread *td, char *path, enum uio_seg pathseg, 1028f19eb88SIan Dowse char *buf, enum uio_seg bufseg, int count); 103*b88ec951SJohn Baldwin int kern_readv(struct thread *td, int fd, struct uio *auio); 1048f19eb88SIan Dowse int kern_rename(struct thread *td, char *from, char *to, 1058f19eb88SIan Dowse enum uio_seg pathseg); 1068f19eb88SIan Dowse int kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg); 107*b88ec951SJohn Baldwin int kern_sched_rr_get_interval(struct thread *td, pid_t pid, 108*b88ec951SJohn Baldwin struct timespec *ts); 1098f19eb88SIan Dowse int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, 1108f19eb88SIan Dowse fd_set *fd_ex, struct timeval *tvp); 111710c5645SDavid Malone int kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, 112a6886ef1SMaxim Sobolev struct mbuf *control, enum uio_seg segflg); 11323af91dcSMaxim Sobolev int kern_setitimer(struct thread *, u_int, struct itimerval *, 11423af91dcSMaxim Sobolev struct itimerval *); 115c8837938SJohn Baldwin int kern_setrlimit(struct thread *, u_int, struct rlimit *); 116e140eb43SDavid Malone int kern_setsockopt(struct thread *td, int s, int level, int name, 117e140eb43SDavid Malone void *optval, enum uio_seg valseg, socklen_t valsize); 118*b88ec951SJohn Baldwin int kern_settimeofday(struct thread *td, struct timeval *tv, 119*b88ec951SJohn Baldwin struct timezone *tzp); 120f130dcf2SMartin Blapp int kern_shmat(struct thread *td, int shmid, const void *shmaddr, 1212332251cSMax Khon int shmflg); 122f130dcf2SMartin Blapp int kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, 1232332251cSMax Khon size_t *bufsz); 1248f19eb88SIan Dowse int kern_sigaction(struct thread *td, int sig, struct sigaction *act, 12523eeeff7SPeter Wemm struct sigaction *oact, int flags); 1268f19eb88SIan Dowse int kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); 127e77daab1SJohn Baldwin int kern_sigprocmask(struct thread *td, int how, 128e77daab1SJohn Baldwin sigset_t *set, sigset_t *oset, int old); 1298f19eb88SIan Dowse int kern_sigsuspend(struct thread *td, sigset_t mask); 13076951d21SJohn Baldwin int kern_stat(struct thread *td, char *path, enum uio_seg pathseg, 13176951d21SJohn Baldwin struct stat *sbp); 13276951d21SJohn Baldwin int kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, 13376951d21SJohn Baldwin struct statfs *buf); 1348f19eb88SIan Dowse int kern_symlink(struct thread *td, char *path, char *link, 1358f19eb88SIan Dowse enum uio_seg segflg); 1368f19eb88SIan Dowse int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, 1378f19eb88SIan Dowse off_t length); 1388f19eb88SIan Dowse int kern_unlink(struct thread *td, char *path, enum uio_seg pathseg); 1398f19eb88SIan Dowse int kern_utimes(struct thread *td, char *path, enum uio_seg pathseg, 1408f19eb88SIan Dowse struct timeval *tptr, enum uio_seg tptrseg); 141c8837938SJohn Baldwin int kern_wait(struct thread *td, pid_t pid, int *status, int options, 142c8837938SJohn Baldwin struct rusage *rup); 143*b88ec951SJohn Baldwin int kern_writev(struct thread *td, int fd, struct uio *auio); 1448f19eb88SIan Dowse 14523eeeff7SPeter Wemm /* flags for kern_sigaction */ 14623eeeff7SPeter Wemm #define KSA_OSIGSET 0x0001 /* uses osigact_t */ 14723eeeff7SPeter Wemm #define KSA_FREEBSD4 0x0002 /* uses ucontext4 */ 14823eeeff7SPeter Wemm 1498f19eb88SIan Dowse #endif /* !_SYS_SYSCALLSUBR_H_ */ 150