syscallsubr.h revision 160765
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 160765 2006-07-27 19:54:41Z jhb $
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
37160765Sjhbstruct file;
38141471Sjhbstruct itimerval;
39141471Sjhbstruct image_args;
40135764Sjhbstruct mbuf;
41135764Sjhbstruct msghdr;
42141471Sjhbstruct msqid_ds;
43139739Sjhbstruct rlimit;
44136152Sjhbstruct rusage;
45159991Sjhbunion semun;
46110294Sumestruct sockaddr;
47141471Sjhbstruct stat;
48142933Spsstruct kevent;
49146950Spsstruct kevent_copyops;
50156114Spsstruct sendfile_args;
51110294Sume
52102870Siedowseint	kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg,
53102870Siedowse	    u_int buflen);
54160249Sjhbint	kern_accept(struct thread *td, int s, struct sockaddr **name,
55160765Sjhb	    socklen_t *namelen, struct file **fp);
56102779Siedowseint	kern_access(struct thread *td, char *path, enum uio_seg pathseg,
57102779Siedowse	    int flags);
58144445Sjhbint	kern_adjtime(struct thread *td, struct timeval *delta,
59144445Sjhb	    struct timeval *olddelta);
60141471Sjhbint	kern_alternate_path(struct thread *td, const char *prefix, char *path,
61141471Sjhb	    enum uio_seg pathseg, char **pathbuf, int create);
62110294Sumeint	kern_bind(struct thread *td, int fd, struct sockaddr *sa);
63102779Siedowseint	kern_chdir(struct thread *td, char *path, enum uio_seg pathseg);
64102779Siedowseint	kern_chmod(struct thread *td, char *path, enum uio_seg pathseg,
65102779Siedowse	    int mode);
66102779Siedowseint	kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
67102779Siedowse	    int gid);
68151357Spsint	kern_clock_getres(struct thread *td, clockid_t clock_id,
69151357Sps	    struct timespec *ts);
70151357Spsint	kern_clock_gettime(struct thread *td, clockid_t clock_id,
71151357Sps	    struct timespec *ats);
72151357Spsint	kern_clock_settime(struct thread *td, clockid_t clock_id,
73151357Sps	    struct timespec *ats);
74160190Sjhbint	kern_close(struct thread *td, int fd);
75110294Sumeint	kern_connect(struct thread *td, int fd, struct sockaddr *sa);
76155401Sjhbint	kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg,
77155401Sjhb	    int flags);
78140992Ssobomaxint	kern_execve(struct thread *td, struct image_args *args,
79139739Sjhb	    struct mac *mac_p);
80102868Siedowseint	kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg);
81141471Sjhbint	kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf);
82141471Sjhbint	kern_fstat(struct thread *td, int fd, struct stat *sbp);
83141471Sjhbint	kern_fstatfs(struct thread *td, int fd, struct statfs *buf);
84102779Siedowseint	kern_futimes(struct thread *td, int fd, struct timeval *tptr,
85102779Siedowse	    enum uio_seg tptrseg);
86147302Spjdint	kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
87147178Spjd	    enum uio_seg bufseg, int flags);
88160139Sjhbint	kern_getgroups(struct thread *td, u_int *ngrp, gid_t *groups);
89140836Ssobomaxint	kern_getitimer(struct thread *, u_int, struct itimerval *);
90160249Sjhbint	kern_getpeername(struct thread *td, int fd, struct sockaddr **sa,
91160249Sjhb	    socklen_t *alen);
92136152Sjhbint	kern_getrusage(struct thread *td, int who, struct rusage *rup);
93160249Sjhbint	kern_getsockname(struct thread *td, int fd, struct sockaddr **sa,
94160249Sjhb	    socklen_t *alen);
95132313Sdwmaloneint	kern_getsockopt(struct thread *td, int s, int level, int name,
96132313Sdwmalone	    void *optval, enum uio_seg valseg, socklen_t *valsize);
97160192Sjhbint	kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data);
98146950Spsint	kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
99146950Sps	    struct kevent_copyops *k_ops, const struct timespec *timeout);
100159588Sjhbint	kern_kldload(struct thread *td, const char *file, int *fileid);
101159588Sjhbint	kern_kldunload(struct thread *td, int fileid, int flags);
102102779Siedowseint	kern_lchown(struct thread *td, char *path, enum uio_seg pathseg,
103102779Siedowse	    int uid, int gid);
104102779Siedowseint	kern_link(struct thread *td, char *path, char *link,
105102779Siedowse	    enum uio_seg segflg);
106141471Sjhbint	kern_lstat(struct thread *td, char *path, enum uio_seg pathseg,
107141471Sjhb	    struct stat *sbp);
108102779Siedowseint	kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg,
109102779Siedowse	    struct timeval *tptr, enum uio_seg tptrseg);
110102779Siedowseint	kern_mkdir(struct thread *td, char *path, enum uio_seg segflg,
111102779Siedowse	    int mode);
112102779Siedowseint	kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg,
113102779Siedowse	    int mode);
114102779Siedowseint	kern_mknod(struct thread *td, char *path, enum uio_seg pathseg,
115102779Siedowse	    int mode, int dev);
116141471Sjhbint	kern_msgctl(struct thread *, int, int, struct msqid_ds *);
117140483Spsint     kern_nanosleep(struct thread *td, struct timespec *rqt,
118140483Sps	    struct timespec *rmt);
119102779Siedowseint	kern_open(struct thread *td, char *path, enum uio_seg pathseg,
120102779Siedowse	    int flags, int mode);
121141484Sjhbint	kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg,
122141484Sjhb	    int name);
123147813Sjhbint	kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset);
124102946Siedowseint	kern_ptrace(struct thread *td, int req, pid_t pid, void *addr,
125102946Siedowse	    int data);
126147813Sjhbint	kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset);
127102779Siedowseint	kern_readlink(struct thread *td, char *path, enum uio_seg pathseg,
128102779Siedowse	    char *buf, enum uio_seg bufseg, int count);
129144445Sjhbint	kern_readv(struct thread *td, int fd, struct uio *auio);
130160249Sjhbint	kern_recvit(struct thread *td, int s, struct msghdr *mp,
131160249Sjhb	    enum uio_seg fromseg, struct mbuf **controlp);
132102779Siedowseint	kern_rename(struct thread *td, char *from, char *to,
133102779Siedowse	    enum uio_seg pathseg);
134102779Siedowseint	kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg);
135144445Sjhbint	kern_sched_rr_get_interval(struct thread *td, pid_t pid,
136144445Sjhb	    struct timespec *ts);
137159991Sjhbint	kern_semctl(struct thread *td, int semid, int semnum, int cmd,
138160187Sjhb	    union semun *arg, register_t *rval);
139102779Siedowseint	kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
140102779Siedowse	    fd_set *fd_ex, struct timeval *tvp);
141156114Spsint	kern_sendfile(struct thread *td, struct sendfile_args *uap,
142156114Sps	    struct uio *hdr_uio, struct uio *trl_uio, int compat);
143114749Sdwmaloneint	kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags,
144141029Ssobomax	    struct mbuf *control, enum uio_seg segflg);
145160139Sjhbint	kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups);
146140836Ssobomaxint	kern_setitimer(struct thread *, u_int, struct itimerval *,
147140836Ssobomax	    struct itimerval *);
148139739Sjhbint	kern_setrlimit(struct thread *, u_int, struct rlimit *);
149132313Sdwmaloneint	kern_setsockopt(struct thread *td, int s, int level, int name,
150132313Sdwmalone	    void *optval, enum uio_seg valseg, socklen_t valsize);
151144445Sjhbint	kern_settimeofday(struct thread *td, struct timeval *tv,
152144445Sjhb	    struct timezone *tzp);
153114724Smbrint	kern_shmat(struct thread *td, int shmid, const void *shmaddr,
154122088Sfjoe	    int shmflg);
155114724Smbrint	kern_shmctl(struct thread *td, int shmid, int cmd, void *buf,
156122088Sfjoe	    size_t *bufsz);
157102779Siedowseint	kern_sigaction(struct thread *td, int sig, struct sigaction *act,
158105950Speter	    struct sigaction *oact, int flags);
159102779Siedowseint	kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss);
160113685Sjhbint	kern_sigprocmask(struct thread *td, int how,
161113685Sjhb	    sigset_t *set, sigset_t *oset, int old);
162102779Siedowseint	kern_sigsuspend(struct thread *td, sigset_t mask);
163141471Sjhbint	kern_stat(struct thread *td, char *path, enum uio_seg pathseg,
164141471Sjhb	    struct stat *sbp);
165141471Sjhbint	kern_statfs(struct thread *td, char *path, enum uio_seg pathseg,
166141471Sjhb	    struct statfs *buf);
167102779Siedowseint	kern_symlink(struct thread *td, char *path, char *link,
168102779Siedowse	    enum uio_seg segflg);
169102779Siedowseint	kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,
170102779Siedowse	    off_t length);
171102779Siedowseint	kern_unlink(struct thread *td, char *path, enum uio_seg pathseg);
172102779Siedowseint	kern_utimes(struct thread *td, char *path, enum uio_seg pathseg,
173102779Siedowse	    struct timeval *tptr, enum uio_seg tptrseg);
174139739Sjhbint	kern_wait(struct thread *td, pid_t pid, int *status, int options,
175139739Sjhb	    struct rusage *rup);
176144445Sjhbint	kern_writev(struct thread *td, int fd, struct uio *auio);
177102779Siedowse
178105950Speter/* flags for kern_sigaction */
179105950Speter#define	KSA_OSIGSET	0x0001	/* uses osigact_t */
180105950Speter#define	KSA_FREEBSD4	0x0002	/* uses ucontext4 */
181105950Speter
182102779Siedowse#endif /* !_SYS_SYSCALLSUBR_H_ */
183