xref: /freebsd/sys/sys/syscallsubr.h (revision f5449510)
160727d8bSWarner Losh /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3c4e20cadSPedro F. Giffuni  *
48f19eb88SIan Dowse  * Copyright (c) 2002 Ian Dowse.  All rights reserved.
58f19eb88SIan Dowse  *
68f19eb88SIan Dowse  * Redistribution and use in source and binary forms, with or without
78f19eb88SIan Dowse  * modification, are permitted provided that the following conditions
88f19eb88SIan Dowse  * are met:
98f19eb88SIan Dowse  * 1. Redistributions of source code must retain the above copyright
108f19eb88SIan Dowse  *    notice, this list of conditions and the following disclaimer.
118f19eb88SIan Dowse  * 2. Redistributions in binary form must reproduce the above copyright
128f19eb88SIan Dowse  *    notice, this list of conditions and the following disclaimer in the
138f19eb88SIan Dowse  *    documentation and/or other materials provided with the distribution.
148f19eb88SIan Dowse  *
158f19eb88SIan Dowse  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
168f19eb88SIan Dowse  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
178f19eb88SIan Dowse  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
188f19eb88SIan Dowse  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
198f19eb88SIan Dowse  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
208f19eb88SIan Dowse  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
218f19eb88SIan Dowse  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
228f19eb88SIan Dowse  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
238f19eb88SIan Dowse  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
248f19eb88SIan Dowse  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
258f19eb88SIan Dowse  * SUCH DAMAGE.
268f19eb88SIan Dowse  */
278f19eb88SIan Dowse 
288f19eb88SIan Dowse #ifndef _SYS_SYSCALLSUBR_H_
298f19eb88SIan Dowse #define _SYS_SYSCALLSUBR_H_
308f19eb88SIan Dowse 
318f19eb88SIan Dowse #include <sys/signal.h>
32e140eb43SDavid Malone #include <sys/socket.h>
3384e0b075SDavid Xu #include <sys/mac.h>
3476951d21SJohn Baldwin #include <sys/mount.h>
3596ee4310SEdward Tomasz Napierala #include <sys/_cpuset.h>
363f289c3fSJeff Roberson #include <sys/_domainset.h>
3734a77b97SBrooks Davis #include <sys/_uio.h>
388f19eb88SIan Dowse 
3934a77b97SBrooks Davis struct __wrusage;
4047a57144SJustin Hibbits struct cpuset_copy_cb;
41f30e89ceSJohn Baldwin struct file;
428328babdSEd Schouten struct filecaps;
4343bdcf93SKonstantin Belousov enum idtype;
4476951d21SJohn Baldwin struct itimerval;
4576951d21SJohn Baldwin struct image_args;
460304c731SJamie Gritton struct jail;
47c1aa81b6SPaul Saab struct kevent;
48efe5becaSPaul Saab struct kevent_copyops;
4986665509SKonstantin Belousov struct kld_file_stat;
50fc0de8f0SJohn Baldwin struct ksiginfo;
5143bdcf93SKonstantin Belousov struct mbuf;
5243bdcf93SKonstantin Belousov struct msghdr;
5343bdcf93SKonstantin Belousov struct msqid_ds;
54186d9c34SDmitry Chagin struct pollfd;
557332c129SKonstantin Belousov struct ogetdirentries_args;
5643bdcf93SKonstantin Belousov struct rlimit;
5743bdcf93SKonstantin Belousov struct rusage;
5834a77b97SBrooks Davis struct sched_param;
59f04534f5SDmitry Chagin struct sembuf;
6043bdcf93SKonstantin Belousov union semun;
6143bdcf93SKonstantin Belousov struct sockaddr;
620dc332bfSKa Ho Ng struct spacectl_range;
6343bdcf93SKonstantin Belousov struct stat;
6443bdcf93SKonstantin Belousov struct thr_param;
65be2535b0SKonstantin Belousov struct timex;
6634a77b97SBrooks Davis struct uio;
6767a659d2SKonstantin Belousov struct vm_map;
68aaf78c16SKonstantin Belousov struct vmspace;
6912e4397eSHajimu UMEMOTO 
7018348a23SKyle Evans typedef int (*mmap_check_fp_fn)(struct file *, int, int, int);
7118348a23SKyle Evans 
72d718de81SBrooks Davis struct mmap_req {
73d718de81SBrooks Davis 	vm_offset_t		mr_hint;
74d718de81SBrooks Davis 	vm_size_t		mr_len;
75d718de81SBrooks Davis 	int			mr_prot;
76d718de81SBrooks Davis 	int			mr_flags;
77d718de81SBrooks Davis 	int			mr_fd;
78d718de81SBrooks Davis 	off_t			mr_pos;
79d718de81SBrooks Davis 	mmap_check_fp_fn	mr_check_fp_fn;
80d718de81SBrooks Davis };
81d718de81SBrooks Davis 
82cb858340SDmitry Chagin uint64_t at2cnpflags(u_int at_flags, u_int mask);
83d718de81SBrooks Davis int	kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg,
84d718de81SBrooks Davis 	    size_t buflen, size_t path_max);
85e02f64d9SBrooks Davis int	kern_abort2(struct thread *td, const char *why, int nargs,
86e02f64d9SBrooks Davis 	    void **uargs);
87cfb1e929SGleb Smirnoff int	kern_accept(struct thread *td, int s, struct sockaddr *sa,
88cfb1e929SGleb Smirnoff 	    struct file **fp);
89cfb1e929SGleb Smirnoff int	kern_accept4(struct thread *td, int s, struct sockaddr *sa,
90cfb1e929SGleb Smirnoff 	    int flags, struct file **fp);
9112e69f96SBrooks Davis int	kern_accessat(struct thread *td, int fd, const char *path,
92e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, int flags, int mode);
93b88ec951SJohn Baldwin int	kern_adjtime(struct thread *td, struct timeval *delta,
94b88ec951SJohn Baldwin 	    struct timeval *olddelta);
956e646651SKonstantin Belousov int	kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa);
96e8a1ec3eSEd Maste int	kern_break(struct thread *td, uintptr_t *addr);
970dac22d8SPawel Jakub Dawidek int	kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds,
980dac22d8SPawel Jakub Dawidek 	    size_t ncmds);
99aa04a06dSEd Schouten int	kern_cap_rights_limit(struct thread *td, int fd, cap_rights_t *rights);
10012e69f96SBrooks Davis int	kern_chdir(struct thread *td, const char *path, enum uio_seg pathseg);
101d31e4b3aSKonstantin Belousov int	kern_clock_getcpuclockid2(struct thread *td, id_t id, int which,
102d31e4b3aSKonstantin Belousov 	    clockid_t *clk_id);
103f0b479cdSPaul Saab int	kern_clock_getres(struct thread *td, clockid_t clock_id,
104f0b479cdSPaul Saab 	    struct timespec *ts);
105f0b479cdSPaul Saab int	kern_clock_gettime(struct thread *td, clockid_t clock_id,
106f0b479cdSPaul Saab 	    struct timespec *ats);
1073f8455b0SEric van Gyzen int	kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags,
1083f8455b0SEric van Gyzen 	    const struct timespec *rqtp, struct timespec *rmtp);
109f0b479cdSPaul Saab int	kern_clock_settime(struct thread *td, clockid_t clock_id,
110f0b479cdSPaul Saab 	    struct timespec *ats);
111cbc10891SDmitry Chagin void	kern_thread_cputime(struct thread *targettd, struct timespec *ats);
112cbc10891SDmitry Chagin void	kern_process_cputime(struct proc *targetp, struct timespec *ats);
113f3f3e3c4SMateusz Guzik int	kern_close_range(struct thread *td, int flags, u_int lowfd, u_int highfd);
114c1cccebeSJohn Baldwin int	kern_close(struct thread *td, int fd);
1156e646651SKonstantin Belousov int	kern_connectat(struct thread *td, int dirfd, int fd,
1166e646651SKonstantin Belousov 	    struct sockaddr *sa);
117bbbbeca3SRick Macklem int	kern_copy_file_range(struct thread *td, int infd, off_t *inoffp,
118bbbbeca3SRick Macklem 	    int outfd, off_t *outoffp, size_t len, unsigned int flags);
119d46174cdSDmitry Chagin int	user_cpuset_getaffinity(struct thread *td, cpulevel_t level,
12047a57144SJustin Hibbits 	    cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *maskp,
12147a57144SJustin Hibbits 	    const struct cpuset_copy_cb *cb);
122d46174cdSDmitry Chagin int	kern_cpuset_getaffinity(struct thread *td, cpulevel_t level,
123d46174cdSDmitry Chagin 	    cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask);
12496ee4310SEdward Tomasz Napierala int	kern_cpuset_setaffinity(struct thread *td, cpulevel_t level,
125f35093f8SDmitry Chagin 	    cpuwhich_t which, id_t id, cpuset_t *maskp);
126f35093f8SDmitry Chagin int	user_cpuset_setaffinity(struct thread *td, cpulevel_t level,
12796ee4310SEdward Tomasz Napierala 	    cpuwhich_t which, id_t id, size_t cpusetsize,
12847a57144SJustin Hibbits 	    const cpuset_t *maskp, const struct cpuset_copy_cb *cb);
1293f289c3fSJeff Roberson int	kern_cpuset_getdomain(struct thread *td, cpulevel_t level,
1303f289c3fSJeff Roberson 	    cpuwhich_t which, id_t id, size_t domainsetsize,
13147a57144SJustin Hibbits 	    domainset_t *maskp, int *policyp, const struct cpuset_copy_cb *cb);
1323f289c3fSJeff Roberson int	kern_cpuset_setdomain(struct thread *td, cpulevel_t level,
1333f289c3fSJeff Roberson 	    cpuwhich_t which, id_t id, size_t domainsetsize,
13447a57144SJustin Hibbits 	    const domainset_t *maskp, int policy, const struct cpuset_copy_cb *cb);
135ea2ebdc1SEdward Tomasz Napierala int	kern_cpuset_getid(struct thread *td, cpulevel_t level,
136ea2ebdc1SEdward Tomasz Napierala 	    cpuwhich_t which, id_t id, cpusetid_t *setid);
137ea2ebdc1SEdward Tomasz Napierala int	kern_cpuset_setid(struct thread *td, cpuwhich_t which,
138ea2ebdc1SEdward Tomasz Napierala 	    id_t id, cpusetid_t setid);
1395fe97c20SMateusz Guzik int	kern_dup(struct thread *td, u_int mode, int flags, int old, int new);
140610ecfe0SMaxim Sobolev int	kern_execve(struct thread *td, struct image_args *args,
141aaf78c16SKonstantin Belousov 	    struct mac *mac_p, struct vmspace *oldvmspace);
1423555be01SJohn Baldwin int	kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace,
1433555be01SJohn Baldwin 	    const char *attrname);
1443555be01SJohn Baldwin int	kern_extattr_delete_path(struct thread *td, const char *path,
1453555be01SJohn Baldwin 	    int attrnamespace, const char *attrname, int follow,
1463555be01SJohn Baldwin 	    enum uio_seg pathseg);
1473555be01SJohn Baldwin int	kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace,
1483555be01SJohn Baldwin 	    const char *attrname, void *data, size_t nbytes);
1493555be01SJohn Baldwin int	kern_extattr_get_path(struct thread *td, const char *path,
1503555be01SJohn Baldwin 	    int attrnamespace, const char *attrname, void *data,
1513555be01SJohn Baldwin 	    size_t nbytes, int follow, enum uio_seg pathseg);
1523555be01SJohn Baldwin int	kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace,
1533555be01SJohn Baldwin 	    struct uio *auiop);
1543555be01SJohn Baldwin int	kern_extattr_list_path(struct thread *td, const char *path,
1553555be01SJohn Baldwin 	    int attrnamespace, struct uio *auiop, int follow,
1563555be01SJohn Baldwin 	    enum uio_seg pathseg);
1573555be01SJohn Baldwin int	kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace,
1583555be01SJohn Baldwin 	    const char *attrname, void *data, size_t nbytes);
1593555be01SJohn Baldwin int	kern_extattr_set_path(struct thread *td, const char *path,
1603555be01SJohn Baldwin 	    int attrnamespace, const char *attrname, void *data,
1613555be01SJohn Baldwin 	    size_t nbytes, int follow, enum uio_seg pathseg);
16212e69f96SBrooks Davis int	kern_fchmodat(struct thread *td, int fd, const char *path,
163e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, mode_t mode, int flag);
16412e69f96SBrooks Davis int	kern_fchownat(struct thread *td, int fd, const char *path,
165e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, int uid, int gid, int flag);
16649c2ff15SIan Dowse int	kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg);
167f5449510SKonstantin Belousov int	kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg);
168de774e42SConrad Meyer int	kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags);
16976dcec5dSGleb Kurtsou int	kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf);
17076951d21SJohn Baldwin int	kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf);
171b1288166SJohn Baldwin int	kern_fpathconf(struct thread *td, int fd, int name, long *valuep);
1722b9d052dSBrooks Davis int	kern_freebsd11_getfsstat(struct thread *td,
1732b9d052dSBrooks Davis 	    struct freebsd11_statfs *ubuf, long bufsize, int mode);
17476951d21SJohn Baldwin int	kern_fstat(struct thread *td, int fd, struct stat *sbp);
17576951d21SJohn Baldwin int	kern_fstatfs(struct thread *td, int fd, struct statfs *buf);
17693d9ebd8SEd Schouten int	kern_fsync(struct thread *td, int fd, bool fullsync);
177e4650294SJohn Baldwin int	kern_ftruncate(struct thread *td, int fd, off_t length);
178b7fd8611SBrooks Davis int	kern_futimes(struct thread *td, int fd, const struct timeval *tptr,
1798f19eb88SIan Dowse 	    enum uio_seg tptrseg);
180b7fd8611SBrooks Davis int	kern_futimens(struct thread *td, int fd, const struct timespec *tptr,
1812205e0d1SJilles Tjoelker 	    enum uio_seg tptrseg);
18269921123SKonstantin Belousov int	kern_getdirentries(struct thread *td, int fd, char *buf, size_t count,
18369921123SKonstantin Belousov 	    off_t *basep, ssize_t *residp, enum uio_seg bufseg);
184de774e42SConrad Meyer int	kern_getfhat(struct thread *td, int flags, int fd, const char *path,
185de774e42SConrad Meyer 	    enum uio_seg pathseg, fhandle_t *fhp, enum uio_seg fhseg);
1863a996d6eSPawel Jakub Dawidek int	kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
18734ed0c63SJohn Baldwin 	    size_t *countp, enum uio_seg bufseg, int mode);
18823af91dcSMaxim Sobolev int	kern_getitimer(struct thread *, u_int, struct itimerval *);
189abd386baSMateusz Guzik int	kern_getppid(struct thread *);
1900fac350cSGleb Smirnoff int	kern_getpeername(struct thread *td, int fd, struct sockaddr *sa);
191ca603bb1SEdward Tomasz Napierala int	kern_getpriority(struct thread *td, int which, int who);
19278c85e8dSJohn Baldwin int	kern_getrusage(struct thread *td, int who, struct rusage *rup);
193be2cfdbcSEdward Tomasz Napierala int	kern_getsid(struct thread *td, pid_t pid);
1940fac350cSGleb Smirnoff int	kern_getsockname(struct thread *td, int fd, struct sockaddr *sa);
195e140eb43SDavid Malone int	kern_getsockopt(struct thread *td, int s, int level, int name,
196e140eb43SDavid Malone 	    void *optval, enum uio_seg valseg, socklen_t *valsize);
197d9f46233SJohn Baldwin int	kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data);
198c542c43eSJamie Gritton int	kern_jail(struct thread *td, struct jail *j);
199b38ff370SJamie Gritton int	kern_jail_get(struct thread *td, struct uio *options, int flags);
200b38ff370SJamie Gritton int	kern_jail_set(struct thread *td, struct uio *options, int flags);
201d8decc9aSKonstantin Belousov int	kern_kcmp(struct thread *td, pid_t pid1, pid_t pid2, int type,
202d8decc9aSKonstantin Belousov 	    uintptr_t idx1, uintptr_t idx2);
203efe5becaSPaul Saab int	kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
204efe5becaSPaul Saab 	    struct kevent_copyops *k_ops, const struct timespec *timeout);
205e26f6b5fSEd Schouten int	kern_kevent_anonymous(struct thread *td, int nevents,
206e26f6b5fSEd Schouten 	    struct kevent_copyops *k_ops);
2077236f2c2SDmitry Chagin int	kern_kevent_fp(struct thread *td, struct file *fp, int nchanges,
2087236f2c2SDmitry Chagin 	    int nevents, struct kevent_copyops *k_ops,
2097236f2c2SDmitry Chagin 	    const struct timespec *timeout);
21034ad5ac2SEdward Tomasz Napierala int	kern_kill(struct thread *td, pid_t pid, int signum);
211a2034cc9SEd Schouten int	kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps);
212d5388587SJohn Baldwin int	kern_kldload(struct thread *td, const char *file, int *fileid);
21386665509SKonstantin Belousov int	kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat);
214d5388587SJohn Baldwin int	kern_kldunload(struct thread *td, int fileid, int flags);
21512e69f96SBrooks Davis int	kern_linkat(struct thread *td, int fd1, int fd2, const char *path1,
2165d1d844aSEdward Tomasz Napierala 	    const char *path2, enum uio_seg segflg, int flag);
217d293f35cSEdward Tomasz Napierala int	kern_listen(struct thread *td, int s, int backlog);
218f67d6b5fSEdward Tomasz Napierala int	kern_lseek(struct thread *td, int fd, off_t offset, int whence);
21912e69f96SBrooks Davis int	kern_lutimes(struct thread *td, const char *path, enum uio_seg pathseg,
220b7fd8611SBrooks Davis 	    const struct timeval *tptr, enum uio_seg tptrseg);
221496ab053SKonstantin Belousov int	kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav);
22214505c92SJohn Baldwin int	kern_membarrier(struct thread *td, int cmd, unsigned flags,
22314505c92SJohn Baldwin 	    int cpu_id);
22446dc8e9dSDmitry Chagin int	kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec);
22552c81be1SEdward Tomasz Napierala int	kern_minherit(struct thread *td, uintptr_t addr, size_t len,
22652c81be1SEdward Tomasz Napierala 	    int inherit);
22712e69f96SBrooks Davis int	kern_mkdirat(struct thread *td, int fd, const char *path,
228e4193f25SKonstantin Belousov 	    enum uio_seg segflg, int mode);
22912e69f96SBrooks Davis int	kern_mkfifoat(struct thread *td, int fd, const char *path,
230e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, int mode);
23112e69f96SBrooks Davis int	kern_mknodat(struct thread *td, int fd, const char *path,
23269921123SKonstantin Belousov 	    enum uio_seg pathseg, int mode, dev_t dev);
233496ab053SKonstantin Belousov int	kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr,
234496ab053SKonstantin Belousov 	    size_t len);
2357a1591c1SBrooks Davis int	kern_mmap(struct thread *td, const struct mmap_req *mrp);
23667a659d2SKonstantin Belousov int	kern_mmap_racct_check(struct thread *td, struct vm_map *map,
23767a659d2SKonstantin Belousov 	    vm_size_t size);
2385dc7e31aSKonstantin Belousov int	kern_mmap_maxprot(struct proc *p, int prot);
2399b65fa69SKonstantin Belousov int	kern_mprotect(struct thread *td, uintptr_t addr, size_t size,
2409b65fa69SKonstantin Belousov 	    int prot, int flags);
24176951d21SJohn Baldwin int	kern_msgctl(struct thread *, int, int, struct msqid_ds *);
2424e4de5e4SJung-uk Kim int	kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *);
2433fdcf9efSKonstantin Belousov int	kern_msgsnd(struct thread *, int, const void *, size_t, int, long);
244496ab053SKonstantin Belousov int	kern_msync(struct thread *td, uintptr_t addr, size_t size, int flags);
245496ab053SKonstantin Belousov int	kern_munlock(struct thread *td, uintptr_t addr, size_t size);
246496ab053SKonstantin Belousov int	kern_munmap(struct thread *td, uintptr_t addr, size_t size);
247efa42cbcSPaul Saab int     kern_nanosleep(struct thread *td, struct timespec *rqt,
248efa42cbcSPaul Saab 	    struct timespec *rmt);
249be2535b0SKonstantin Belousov int	kern_ntp_adjtime(struct thread *td, struct timex *ntv, int *retvalp);
2507332c129SKonstantin Belousov int	kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap,
2517332c129SKonstantin Belousov 	    long *ploff);
25201ce7fcaSBrooks Davis int	kern_ommap(struct thread *td, uintptr_t hint, int len, int oprot,
25301ce7fcaSBrooks Davis 	    int oflags, int fd, long pos);
2542a284076SKonstantin Belousov int	kern_openat(struct thread *td, int dirfd, const char *path,
255e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, int flags, int mode);
256c662306eSKonstantin Belousov int	kern_openatfp(struct thread *td, int dirfd, const char *path,
257c662306eSKonstantin Belousov 	    enum uio_seg pathseg, int flags, int mode, struct file **fpp);
25812e69f96SBrooks Davis int	kern_pathconf(struct thread *td, const char *path,
25912e69f96SBrooks Davis 	    enum uio_seg pathseg, int name, u_long flags, long *valuep);
2608328babdSEd Schouten int	kern_pipe(struct thread *td, int fildes[2], int flags,
2618328babdSEd Schouten 	    struct filecaps *fcaps1, struct filecaps *fcaps2);
262186d9c34SDmitry Chagin int	kern_poll(struct thread *td, struct pollfd *fds, u_int nfds,
263186d9c34SDmitry Chagin 	    struct timespec *tsp, sigset_t *uset);
264e884512aSDmitry Chagin int	kern_poll_kfds(struct thread *td, struct pollfd *fds, u_int nfds,
265e884512aSDmitry Chagin 	    struct timespec *tsp, sigset_t *uset);
266e884512aSDmitry Chagin bool	kern_poll_maxfds(u_int nfds);
2670acf5d0bSMark Johnston int	kern_posix_error(struct thread *td, int error);
2687edec621SJohn Baldwin int	kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len,
2697edec621SJohn Baldwin 	    int advice);
2707edec621SJohn Baldwin int	kern_posix_fallocate(struct thread *td, int fd, off_t offset,
2717edec621SJohn Baldwin 	    off_t len);
2720dc332bfSKa Ho Ng int	kern_fspacectl(struct thread *td, int fd, int cmd,
2730dc332bfSKa Ho Ng 	    const struct spacectl_range *, int flags, struct spacectl_range *);
27455648840SJohn Baldwin int	kern_procctl(struct thread *td, enum idtype idtype, id_t id, int com,
27555648840SJohn Baldwin 	    void *data);
276b38b22b0SEdward Tomasz Napierala int	kern_pread(struct thread *td, int fd, void *buf, size_t nbyte,
277b38b22b0SEdward Tomasz Napierala 	    off_t offset);
278bcd9e0ddSJohn Baldwin int	kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset);
279066d836bSKonstantin Belousov int	kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou,
280066d836bSKonstantin Belousov 	    fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits);
281012e544fSIan Dowse int	kern_ptrace(struct thread *td, int req, pid_t pid, void *addr,
282012e544fSIan Dowse 	    int data);
283b38b22b0SEdward Tomasz Napierala int	kern_pwrite(struct thread *td, int fd, const void *buf, size_t nbyte,
284b38b22b0SEdward Tomasz Napierala 	    off_t offset);
285bcd9e0ddSJohn Baldwin int	kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset);
28612e69f96SBrooks Davis int	kern_readlinkat(struct thread *td, int fd, const char *path,
287e4193f25SKonstantin Belousov 	    enum uio_seg pathseg, char *buf, enum uio_seg bufseg, size_t count);
288b88ec951SJohn Baldwin int	kern_readv(struct thread *td, int fd, struct uio *auio);
289c870740eSJohn Baldwin int	kern_recvit(struct thread *td, int s, struct msghdr *mp,
290c870740eSJohn Baldwin 	    enum uio_seg fromseg, struct mbuf **controlp);
29112e69f96SBrooks Davis int	kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
29212e69f96SBrooks Davis 	    const char *new, enum uio_seg pathseg);
293a1304030SMariusz Zaborski int	kern_frmdirat(struct thread *td, int dfd, const char *path, int fd,
2944f77f488SKonstantin Belousov 	    enum uio_seg pathseg, int flag);
295a93e83c8SDmitry Chagin int	kern_sched_getparam(struct thread *td, struct thread *targettd,
296a93e83c8SDmitry Chagin 	    struct sched_param *param);
297a93e83c8SDmitry Chagin int	kern_sched_getscheduler(struct thread *td, struct thread *targettd,
298a93e83c8SDmitry Chagin 	    int *policy);
299a93e83c8SDmitry Chagin int	kern_sched_setparam(struct thread *td, struct thread *targettd,
300a93e83c8SDmitry Chagin 	    struct sched_param *param);
301a93e83c8SDmitry Chagin int	kern_sched_setscheduler(struct thread *td, struct thread *targettd,
302a93e83c8SDmitry Chagin 	    int policy, struct sched_param *param);
303b88ec951SJohn Baldwin int	kern_sched_rr_get_interval(struct thread *td, pid_t pid,
304b88ec951SJohn Baldwin 	    struct timespec *ts);
3051aa90ecaSDmitry Chagin int	kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd,
3061aa90ecaSDmitry Chagin 	    struct timespec *ts);
30749d409a1SJohn Baldwin int	kern_semctl(struct thread *td, int semid, int semnum, int cmd,
308b1ee5b65SJohn Baldwin 	    union semun *arg, register_t *rval);
3098f19eb88SIan Dowse int	kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
310b55ef216SKonstantin Belousov 	    fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits);
311710c5645SDavid Malone int	kern_sendit(struct thread *td, int s, struct msghdr *mp, int flags,
312a6886ef1SMaxim Sobolev 	    struct mbuf *control, enum uio_seg segflg);
3133cb83e71SJohn Baldwin int	kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups);
31423af91dcSMaxim Sobolev int	kern_setitimer(struct thread *, u_int, struct itimerval *,
31523af91dcSMaxim Sobolev 	    struct itimerval *);
3167a0ef283SEdward Tomasz Napierala int	kern_setpriority(struct thread *td, int which, int who, int prio);
317c8837938SJohn Baldwin int	kern_setrlimit(struct thread *, u_int, struct rlimit *);
318e140eb43SDavid Malone int	kern_setsockopt(struct thread *td, int s, int level, int name,
319318f0d77SBrooks Davis 	    const void *optval, enum uio_seg valseg, socklen_t valsize);
320b88ec951SJohn Baldwin int	kern_settimeofday(struct thread *td, struct timeval *tv,
321b88ec951SJohn Baldwin 	    struct timezone *tzp);
3227ee1b208SEd Schouten int	kern_shm_open(struct thread *td, const char *userpath, int flags,
323535b1df9SKyle Evans 	    mode_t mode, struct filecaps *fcaps);
32420f70576SKyle Evans int	kern_shm_open2(struct thread *td, const char *path, int flags,
325535b1df9SKyle Evans 	    mode_t mode, int shmflags, struct filecaps *fcaps,
326535b1df9SKyle Evans 	    const char *name);
327f130dcf2SMartin Blapp int	kern_shmat(struct thread *td, int shmid, const void *shmaddr,
3282332251cSMax Khon 	    int shmflg);
329f130dcf2SMartin Blapp int	kern_shmctl(struct thread *td, int shmid, int cmd, void *buf,
3302332251cSMax Khon 	    size_t *bufsz);
331d293f35cSEdward Tomasz Napierala int	kern_shutdown(struct thread *td, int s, int how);
332ea566832SEd Schouten int	kern_sigaction(struct thread *td, int sig, const struct sigaction *act,
33323eeeff7SPeter Wemm 	    struct sigaction *oact, int flags);
3348f19eb88SIan Dowse int	kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss);
335fc0de8f0SJohn Baldwin int	kern_sigprocmask(struct thread *td, int how,
336fc0de8f0SJohn Baldwin 	    sigset_t *set, sigset_t *oset, int flags);
3378f19eb88SIan Dowse int	kern_sigsuspend(struct thread *td, sigset_t mask);
338fc0de8f0SJohn Baldwin int	kern_sigtimedwait(struct thread *td, sigset_t waitset,
339fc0de8f0SJohn Baldwin 	    struct ksiginfo *ksi, struct timespec *timeout);
340f19351aaSBrooks Davis int	kern_sigqueue(struct thread *td, pid_t pid, int signum,
341f19351aaSBrooks Davis 	    union sigval *value);
342d293f35cSEdward Tomasz Napierala int	kern_socket(struct thread *td, int domain, int type, int protocol);
34312e69f96SBrooks Davis int	kern_statat(struct thread *td, int flag, int fd, const char *path,
344cb858340SDmitry Chagin 	    enum uio_seg pathseg, struct stat *sbp);
3457a202823SKonstantin Belousov int	kern_specialfd(struct thread *td, int type, void *arg);
34612e69f96SBrooks Davis int	kern_statfs(struct thread *td, const char *path, enum uio_seg pathseg,
34776951d21SJohn Baldwin 	    struct statfs *buf);
34812e69f96SBrooks Davis int	kern_symlinkat(struct thread *td, const char *path1, int fd,
34912e69f96SBrooks Davis 	    const char *path2, enum uio_seg segflg);
350d6fee74aSEdward Tomasz Napierala int	kern_sync(struct thread *td);
351643ee871SKonstantin Belousov int	kern_ktimer_create(struct thread *td, clockid_t clock_id,
352643ee871SKonstantin Belousov 	    struct sigevent *evp, int *timerid, int preset_id);
353643ee871SKonstantin Belousov int	kern_ktimer_delete(struct thread *, int);
354643ee871SKonstantin Belousov int	kern_ktimer_settime(struct thread *td, int timer_id, int flags,
355643ee871SKonstantin Belousov 	    struct itimerspec *val, struct itimerspec *oval);
356643ee871SKonstantin Belousov int	kern_ktimer_gettime(struct thread *td, int timer_id,
357643ee871SKonstantin Belousov 	    struct itimerspec *val);
358e346f8c4SBjoern A. Zeeb int	kern_ktimer_getoverrun(struct thread *td, int timer_id);
359f04534f5SDmitry Chagin int	kern_semop(struct thread *td, int usemid, struct sembuf *usops,
360f04534f5SDmitry Chagin 	    size_t nsops, struct timespec *timeout);
36109baafb4SDmitry Chagin int	kern_thr_alloc(struct proc *, int pages, struct thread **);
36295be6d2bSDmitry Chagin int	kern_thr_exit(struct thread *td);
363a66fde8dSJohn Baldwin int	kern_thr_new(struct thread *td, struct thr_param *param);
364a66fde8dSJohn Baldwin int	kern_thr_suspend(struct thread *td, struct timespec *tsp);
36518cb4223SJohn Baldwin int	kern_timerfd_create(struct thread *td, int clockid, int flags);
36618cb4223SJohn Baldwin int	kern_timerfd_gettime(struct thread *td, int fd,
36718cb4223SJohn Baldwin 	    struct itimerspec *curr_value);
36818cb4223SJohn Baldwin int	kern_timerfd_settime(struct thread *td, int fd, int flags,
36918cb4223SJohn Baldwin 	    const struct itimerspec *new_value, struct itimerspec *old_value);
37012e69f96SBrooks Davis int	kern_truncate(struct thread *td, const char *path,
37112e69f96SBrooks Davis 	    enum uio_seg pathseg, off_t length);
372a1304030SMariusz Zaborski int	kern_funlinkat(struct thread *td, int dfd, const char *path, int fd,
3734f77f488SKonstantin Belousov 	    enum uio_seg pathseg, int flag, ino_t oldinum);
37412e69f96SBrooks Davis int	kern_utimesat(struct thread *td, int fd, const char *path,
375b7fd8611SBrooks Davis 	    enum uio_seg pathseg, const struct timeval *tptr,
376b7fd8611SBrooks Davis 	    enum uio_seg tptrseg);
37712e69f96SBrooks Davis int	kern_utimensat(struct thread *td, int fd, const char *path,
378b7fd8611SBrooks Davis 	    enum uio_seg pathseg, const struct timespec *tptr,
379b7fd8611SBrooks Davis 	    enum uio_seg tptrseg, int flag);
380c8837938SJohn Baldwin int	kern_wait(struct thread *td, pid_t pid, int *status, int options,
381c8837938SJohn Baldwin 	    struct rusage *rup);
382e2d55f48SKonstantin Belousov int	kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status,
383f13b5a0fSKonstantin Belousov 	    int options, struct __wrusage *wrup, siginfo_t *sip);
384b88ec951SJohn Baldwin int	kern_writev(struct thread *td, int fd, struct uio *auio);
3854202e1beSDmitry Chagin int	kern_socketpair(struct thread *td, int domain, int type, int protocol,
3864202e1beSDmitry Chagin 	    int *rsv);
387b3fb13ebSEdward Tomasz Napierala int	kern_unmount(struct thread *td, const char *path, int flags);
3888f19eb88SIan Dowse 
38923eeeff7SPeter Wemm /* flags for kern_sigaction */
39023eeeff7SPeter Wemm #define	KSA_OSIGSET	0x0001	/* uses osigact_t */
39123eeeff7SPeter Wemm #define	KSA_FREEBSD4	0x0002	/* uses ucontext4 */
39223eeeff7SPeter Wemm 
39369921123SKonstantin Belousov struct freebsd11_dirent;
39469921123SKonstantin Belousov 
39569921123SKonstantin Belousov int	freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf, u_int
39669921123SKonstantin Belousov 	    count, long *basep, void (*func)(struct freebsd11_dirent *));
39769921123SKonstantin Belousov 
3988f19eb88SIan Dowse #endif /* !_SYS_SYSCALLSUBR_H_ */
399