syscallsubr.h revision 142933
1139825Simp/*- 2102779Siedowse * Copyright (c) 2002 Ian Dowse. All rights reserved. 3102779Siedowse * 4102779Siedowse * Redistribution and use in source and binary forms, with or without 5102779Siedowse * modification, are permitted provided that the following conditions 6102779Siedowse * are met: 7102779Siedowse * 1. Redistributions of source code must retain the above copyright 8102779Siedowse * notice, this list of conditions and the following disclaimer. 9102779Siedowse * 2. Redistributions in binary form must reproduce the above copyright 10102779Siedowse * notice, this list of conditions and the following disclaimer in the 11102779Siedowse * documentation and/or other materials provided with the distribution. 12102779Siedowse * 13102779Siedowse * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14102779Siedowse * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15102779Siedowse * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16102779Siedowse * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17102779Siedowse * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18102779Siedowse * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19102779Siedowse * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20102779Siedowse * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21102779Siedowse * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22102779Siedowse * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23102779Siedowse * SUCH DAMAGE. 24102779Siedowse * 25102779Siedowse * $FreeBSD: head/sys/sys/syscallsubr.h 142933 2005-03-01 17:44:34Z ps $ 26102779Siedowse */ 27102779Siedowse 28102779Siedowse#ifndef _SYS_SYSCALLSUBR_H_ 29102779Siedowse#define _SYS_SYSCALLSUBR_H_ 30102779Siedowse 31102779Siedowse#include <sys/signal.h> 32102779Siedowse#include <sys/uio.h> 33132313Sdwmalone#include <sys/socket.h> 34136221Sdavidxu#include <sys/mac.h> 35141471Sjhb#include <sys/mount.h> 36102779Siedowse 37141471Sjhbstruct itimerval; 38141471Sjhbstruct image_args; 39135764Sjhbstruct mbuf; 40135764Sjhbstruct msghdr; 41141471Sjhbstruct msqid_ds; 42139739Sjhbstruct rlimit; 43136152Sjhbstruct rusage; 44110294Sumestruct sockaddr; 45141471Sjhbstruct stat; 46142933Spsstruct kevent; 47110294Sume 48102870Siedowseint kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, 49102870Siedowse u_int buflen); 50102779Siedowseint kern_access(struct thread *td, char *path, enum uio_seg pathseg, 51102779Siedowse int flags); 52141471Sjhbint kern_alternate_path(struct thread *td, const char *prefix, char *path, 53141471Sjhb enum uio_seg pathseg, char **pathbuf, int create); 54110294Sumeint kern_bind(struct thread *td, int fd, struct sockaddr *sa); 55102779Siedowseint kern_chdir(struct thread *td, char *path, enum uio_seg pathseg); 56102779Siedowseint kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, 57102779Siedowse int mode); 58102779Siedowseint kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid, 59102779Siedowse int gid); 60110294Sumeint kern_connect(struct thread *td, int fd, struct sockaddr *sa); 61140992Ssobomaxint kern_execve(struct thread *td, struct image_args *args, 62139739Sjhb struct mac *mac_p); 63102868Siedowseint kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); 64141471Sjhbint kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); 65141471Sjhbint kern_fstat(struct thread *td, int fd, struct stat *sbp); 66141471Sjhbint kern_fstatfs(struct thread *td, int fd, struct statfs *buf); 67102779Siedowseint kern_futimes(struct thread *td, int fd, struct timeval *tptr, 68102779Siedowse enum uio_seg tptrseg); 69140836Ssobomaxint kern_getitimer(struct thread *, u_int, struct itimerval *); 70136152Sjhbint kern_getrusage(struct thread *td, int who, struct rusage *rup); 71132313Sdwmaloneint kern_getsockopt(struct thread *td, int s, int level, int name, 72132313Sdwmalone void *optval, enum uio_seg valseg, socklen_t *valsize); 73142933Spsint kern_kevent(struct thread *td, int fd, struct kevent *changelist, 74142933Sps int nchanges, enum uio_seg changeseg, struct kevent *eventlist, 75142933Sps int nevents, enum uio_seg eventseg, const struct timespec *timeout); 76102779Siedowseint kern_lchown(struct thread *td, char *path, enum uio_seg pathseg, 77102779Siedowse int uid, int gid); 78102779Siedowseint kern_link(struct thread *td, char *path, char *link, 79102779Siedowse enum uio_seg segflg); 80141471Sjhbint kern_lstat(struct thread *td, char *path, enum uio_seg pathseg, 81141471Sjhb struct stat *sbp); 82102779Siedowseint kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, 83102779Siedowse struct timeval *tptr, enum uio_seg tptrseg); 84102779Siedowseint kern_mkdir(struct thread *td, char *path, enum uio_seg segflg, 85102779Siedowse int mode); 86102779Siedowseint kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg, 87102779Siedowse int mode); 88102779Siedowseint kern_mknod(struct thread *td, char *path, enum uio_seg pathseg, 89102779Siedowse int mode, int dev); 90141471Sjhbint kern_msgctl(struct thread *, int, int, struct msqid_ds *); 91140483Spsint kern_nanosleep(struct thread *td, struct timespec *rqt, 92140483Sps struct timespec *rmt); 93102779Siedowseint kern_open(struct thread *td, char *path, enum uio_seg pathseg, 94102779Siedowse int flags, int mode); 95141484Sjhbint kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, 96141484Sjhb int name); 97102946Siedowseint kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, 98102946Siedowse int data); 99102779Siedowseint kern_readlink(struct thread *td, char *path, enum uio_seg pathseg, 100102779Siedowse char *buf, enum uio_seg bufseg, int count); 101102779Siedowseint kern_rename(struct thread *td, char *from, char *to, 102102779Siedowse enum uio_seg pathseg); 103102779Siedowseint kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg); 104102779Siedowseint kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, 105102779Siedowse fd_set *fd_ex, struct timeval *tvp); 106114749Sdwmaloneint kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags, 107141029Ssobomax struct mbuf *control, enum uio_seg segflg); 108140836Ssobomaxint kern_setitimer(struct thread *, u_int, struct itimerval *, 109140836Ssobomax struct itimerval *); 110139739Sjhbint kern_setrlimit(struct thread *, u_int, struct rlimit *); 111132313Sdwmaloneint kern_setsockopt(struct thread *td, int s, int level, int name, 112132313Sdwmalone void *optval, enum uio_seg valseg, socklen_t valsize); 113114724Smbrint kern_shmat(struct thread *td, int shmid, const void *shmaddr, 114122088Sfjoe int shmflg); 115114724Smbrint kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, 116122088Sfjoe size_t *bufsz); 117102779Siedowseint kern_sigaction(struct thread *td, int sig, struct sigaction *act, 118105950Speter struct sigaction *oact, int flags); 119102779Siedowseint kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); 120113685Sjhbint kern_sigprocmask(struct thread *td, int how, 121113685Sjhb sigset_t *set, sigset_t *oset, int old); 122102779Siedowseint kern_sigsuspend(struct thread *td, sigset_t mask); 123141471Sjhbint kern_stat(struct thread *td, char *path, enum uio_seg pathseg, 124141471Sjhb struct stat *sbp); 125141471Sjhbint kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, 126141471Sjhb struct statfs *buf); 127102779Siedowseint kern_symlink(struct thread *td, char *path, char *link, 128102779Siedowse enum uio_seg segflg); 129102779Siedowseint kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, 130102779Siedowse off_t length); 131102779Siedowseint kern_unlink(struct thread *td, char *path, enum uio_seg pathseg); 132102779Siedowseint kern_utimes(struct thread *td, char *path, enum uio_seg pathseg, 133102779Siedowse struct timeval *tptr, enum uio_seg tptrseg); 134139739Sjhbint kern_wait(struct thread *td, pid_t pid, int *status, int options, 135139739Sjhb struct rusage *rup); 136102779Siedowse 137105950Speter/* flags for kern_sigaction */ 138105950Speter#define KSA_OSIGSET 0x0001 /* uses osigact_t */ 139105950Speter#define KSA_FREEBSD4 0x0002 /* uses ucontext4 */ 140105950Speter 141102779Siedowse#endif /* !_SYS_SYSCALLSUBR_H_ */ 142