syscallsubr.h revision 159588
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 159588 2006-06-13 21:28:18Z 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
37141471Sjhbstruct itimerval;
38141471Sjhbstruct image_args;
39135764Sjhbstruct mbuf;
40135764Sjhbstruct msghdr;
41141471Sjhbstruct msqid_ds;
42139739Sjhbstruct rlimit;
43136152Sjhbstruct rusage;
44110294Sumestruct sockaddr;
45141471Sjhbstruct stat;
46142933Spsstruct kevent;
47146950Spsstruct kevent_copyops;
48156114Spsstruct sendfile_args;
49110294Sume
50102870Siedowseint	kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg,
51102870Siedowse	    u_int buflen);
52102779Siedowseint	kern_access(struct thread *td, char *path, enum uio_seg pathseg,
53102779Siedowse	    int flags);
54144445Sjhbint	kern_adjtime(struct thread *td, struct timeval *delta,
55144445Sjhb	    struct timeval *olddelta);
56141471Sjhbint	kern_alternate_path(struct thread *td, const char *prefix, char *path,
57141471Sjhb	    enum uio_seg pathseg, char **pathbuf, int create);
58110294Sumeint	kern_bind(struct thread *td, int fd, struct sockaddr *sa);
59102779Siedowseint	kern_chdir(struct thread *td, char *path, enum uio_seg pathseg);
60102779Siedowseint	kern_chmod(struct thread *td, char *path, enum uio_seg pathseg,
61102779Siedowse	    int mode);
62102779Siedowseint	kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
63102779Siedowse	    int gid);
64151357Spsint	kern_clock_getres(struct thread *td, clockid_t clock_id,
65151357Sps	    struct timespec *ts);
66151357Spsint	kern_clock_gettime(struct thread *td, clockid_t clock_id,
67151357Sps	    struct timespec *ats);
68151357Spsint	kern_clock_settime(struct thread *td, clockid_t clock_id,
69151357Sps	    struct timespec *ats);
70110294Sumeint	kern_connect(struct thread *td, int fd, struct sockaddr *sa);
71155401Sjhbint	kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg,
72155401Sjhb	    int flags);
73140992Ssobomaxint	kern_execve(struct thread *td, struct image_args *args,
74139739Sjhb	    struct mac *mac_p);
75102868Siedowseint	kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg);
76141471Sjhbint	kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf);
77141471Sjhbint	kern_fstat(struct thread *td, int fd, struct stat *sbp);
78141471Sjhbint	kern_fstatfs(struct thread *td, int fd, struct statfs *buf);
79102779Siedowseint	kern_futimes(struct thread *td, int fd, struct timeval *tptr,
80102779Siedowse	    enum uio_seg tptrseg);
81147302Spjdint	kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
82147178Spjd	    enum uio_seg bufseg, int flags);
83140836Ssobomaxint	kern_getitimer(struct thread *, u_int, struct itimerval *);
84136152Sjhbint	kern_getrusage(struct thread *td, int who, struct rusage *rup);
85132313Sdwmaloneint	kern_getsockopt(struct thread *td, int s, int level, int name,
86132313Sdwmalone	    void *optval, enum uio_seg valseg, socklen_t *valsize);
87146950Spsint	kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
88146950Sps	    struct kevent_copyops *k_ops, const struct timespec *timeout);
89159588Sjhbint	kern_kldload(struct thread *td, const char *file, int *fileid);
90159588Sjhbint	kern_kldunload(struct thread *td, int fileid, int flags);
91102779Siedowseint	kern_lchown(struct thread *td, char *path, enum uio_seg pathseg,
92102779Siedowse	    int uid, int gid);
93102779Siedowseint	kern_link(struct thread *td, char *path, char *link,
94102779Siedowse	    enum uio_seg segflg);
95141471Sjhbint	kern_lstat(struct thread *td, char *path, enum uio_seg pathseg,
96141471Sjhb	    struct stat *sbp);
97102779Siedowseint	kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg,
98102779Siedowse	    struct timeval *tptr, enum uio_seg tptrseg);
99102779Siedowseint	kern_mkdir(struct thread *td, char *path, enum uio_seg segflg,
100102779Siedowse	    int mode);
101102779Siedowseint	kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg,
102102779Siedowse	    int mode);
103102779Siedowseint	kern_mknod(struct thread *td, char *path, enum uio_seg pathseg,
104102779Siedowse	    int mode, int dev);
105141471Sjhbint	kern_msgctl(struct thread *, int, int, struct msqid_ds *);
106140483Spsint     kern_nanosleep(struct thread *td, struct timespec *rqt,
107140483Sps	    struct timespec *rmt);
108102779Siedowseint	kern_open(struct thread *td, char *path, enum uio_seg pathseg,
109102779Siedowse	    int flags, int mode);
110141484Sjhbint	kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg,
111141484Sjhb	    int name);
112147813Sjhbint	kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset);
113102946Siedowseint	kern_ptrace(struct thread *td, int req, pid_t pid, void *addr,
114102946Siedowse	    int data);
115147813Sjhbint	kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset);
116102779Siedowseint	kern_readlink(struct thread *td, char *path, enum uio_seg pathseg,
117102779Siedowse	    char *buf, enum uio_seg bufseg, int count);
118144445Sjhbint	kern_readv(struct thread *td, int fd, struct uio *auio);
119151359Spsint	kern_recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp,
120151909Sps	    enum uio_seg segflg, struct mbuf **controlp);
121102779Siedowseint	kern_rename(struct thread *td, char *from, char *to,
122102779Siedowse	    enum uio_seg pathseg);
123102779Siedowseint	kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg);
124144445Sjhbint	kern_sched_rr_get_interval(struct thread *td, pid_t pid,
125144445Sjhb	    struct timespec *ts);
126102779Siedowseint	kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
127102779Siedowse	    fd_set *fd_ex, struct timeval *tvp);
128156114Spsint	kern_sendfile(struct thread *td, struct sendfile_args *uap,
129156114Sps	    struct uio *hdr_uio, struct uio *trl_uio, int compat);
130114749Sdwmaloneint	kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags,
131141029Ssobomax	    struct mbuf *control, enum uio_seg segflg);
132140836Ssobomaxint	kern_setitimer(struct thread *, u_int, struct itimerval *,
133140836Ssobomax	    struct itimerval *);
134139739Sjhbint	kern_setrlimit(struct thread *, u_int, struct rlimit *);
135132313Sdwmaloneint	kern_setsockopt(struct thread *td, int s, int level, int name,
136132313Sdwmalone	    void *optval, enum uio_seg valseg, socklen_t valsize);
137144445Sjhbint	kern_settimeofday(struct thread *td, struct timeval *tv,
138144445Sjhb	    struct timezone *tzp);
139114724Smbrint	kern_shmat(struct thread *td, int shmid, const void *shmaddr,
140122088Sfjoe	    int shmflg);
141114724Smbrint	kern_shmctl(struct thread *td, int shmid, int cmd, void *buf,
142122088Sfjoe	    size_t *bufsz);
143102779Siedowseint	kern_sigaction(struct thread *td, int sig, struct sigaction *act,
144105950Speter	    struct sigaction *oact, int flags);
145102779Siedowseint	kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss);
146113685Sjhbint	kern_sigprocmask(struct thread *td, int how,
147113685Sjhb	    sigset_t *set, sigset_t *oset, int old);
148102779Siedowseint	kern_sigsuspend(struct thread *td, sigset_t mask);
149141471Sjhbint	kern_stat(struct thread *td, char *path, enum uio_seg pathseg,
150141471Sjhb	    struct stat *sbp);
151141471Sjhbint	kern_statfs(struct thread *td, char *path, enum uio_seg pathseg,
152141471Sjhb	    struct statfs *buf);
153102779Siedowseint	kern_symlink(struct thread *td, char *path, char *link,
154102779Siedowse	    enum uio_seg segflg);
155102779Siedowseint	kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,
156102779Siedowse	    off_t length);
157102779Siedowseint	kern_unlink(struct thread *td, char *path, enum uio_seg pathseg);
158102779Siedowseint	kern_utimes(struct thread *td, char *path, enum uio_seg pathseg,
159102779Siedowse	    struct timeval *tptr, enum uio_seg tptrseg);
160139739Sjhbint	kern_wait(struct thread *td, pid_t pid, int *status, int options,
161139739Sjhb	    struct rusage *rup);
162144445Sjhbint	kern_writev(struct thread *td, int fd, struct uio *auio);
163102779Siedowse
164105950Speter/* flags for kern_sigaction */
165105950Speter#define	KSA_OSIGSET	0x0001	/* uses osigact_t */
166105950Speter#define	KSA_FREEBSD4	0x0002	/* uses ucontext4 */
167105950Speter
168102779Siedowse#endif /* !_SYS_SYSCALLSUBR_H_ */
169