Lines Matching defs:uap

225 freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
231 if (uap->rusage != NULL)
235 error = kern_wait(td, uap->pid, &status, uap->options, rup);
238 if (uap->status != NULL)
239 error = copyout(&status, uap->status, sizeof(status));
240 if (uap->rusage != NULL && error == 0) {
242 error = copyout(&ru32, uap->rusage, sizeof(ru32));
248 freebsd32_wait6(struct thread *td, struct freebsd32_wait6_args *uap)
256 if (uap->wrusage != NULL)
260 if (uap->info != NULL) {
265 error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id),
266 &status, uap->options, wrup, sip);
269 if (uap->status != NULL)
270 error = copyout(&status, uap->status, sizeof(status));
271 if (uap->wrusage != NULL && error == 0) {
274 error = copyout(&wru32, uap->wrusage, sizeof(wru32));
276 if (uap->info != NULL && error == 0) {
278 error = copyout(&si32, uap->info, sizeof(si32));
315 freebsd32_getfsstat(struct thread *td, struct freebsd32_getfsstat_args *uap)
320 if (uap->bufsize < 0 || uap->bufsize > SIZE_MAX)
322 error = kern_getfsstat(td, &uap->buf, uap->bufsize, &count,
323 UIO_USERSPACE, uap->mode);
332 struct freebsd4_freebsd32_getfsstat_args *uap)
339 count = uap->bufsize / sizeof(struct ostatfs32);
341 error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->mode);
347 error = copyout(&stat32, uap->buf, sizeof(stat32));
349 uap->buf++;
363 struct freebsd11_freebsd32_getfsstat_args *uap)
365 return(kern_freebsd11_getfsstat(td, uap->buf, uap->bufsize,
366 uap->mode));
372 struct freebsd32_sigaltstack_args *uap)
378 if (uap->ss != NULL) {
379 error = copyin(uap->ss, &s32, sizeof(s32));
389 if (error == 0 && uap->oss != NULL) {
393 error = copyout(&s32, uap->oss, sizeof(s32));
471 freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap)
480 error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE,
481 uap->argv, uap->envv);
490 freebsd32_fexecve(struct thread *td, struct freebsd32_fexecve_args *uap)
500 uap->argv, uap->envv);
502 eargs.fd = uap->fd;
511 freebsd32_mknodat(struct thread *td, struct freebsd32_mknodat_args *uap)
514 return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE,
515 uap->mode, PAIR32TO64(dev_t, uap->dev)));
519 freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap)
523 prot = uap->prot;
528 return (kern_mprotect(td, (uintptr_t)PTRIN(uap->addr), uap->len,
533 freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
537 prot = uap->prot;
544 .mr_hint = (uintptr_t)uap->addr,
545 .mr_len = uap->len,
547 .mr_flags = uap->flags,
548 .mr_fd = uap->fd,
549 .mr_pos = PAIR32TO64(off_t, uap->pos),
556 struct freebsd6_freebsd32_mmap_args *uap)
560 prot = uap->prot;
567 .mr_hint = (uintptr_t)uap->addr,
568 .mr_len = uap->len,
570 .mr_flags = uap->flags,
571 .mr_fd = uap->fd,
572 .mr_pos = PAIR32TO64(off_t, uap->pos),
579 ofreebsd32_mmap(struct thread *td, struct ofreebsd32_mmap_args *uap)
581 return (kern_ommap(td, (uintptr_t)uap->addr, uap->len, uap->prot,
582 uap->flags, uap->fd, uap->pos));
587 freebsd32_setitimer(struct thread *td, struct freebsd32_setitimer_args *uap)
593 if (uap->itv != NULL) {
594 error = copyin(uap->itv, &i32, sizeof(i32));
602 error = kern_setitimer(td, uap->which, itvp, &oitv);
603 if (error || uap->oitv == NULL)
607 return (copyout(&i32, uap->oitv, sizeof(i32)));
611 freebsd32_getitimer(struct thread *td, struct freebsd32_getitimer_args *uap)
617 error = kern_getitimer(td, uap->which, &itv);
618 if (error || uap->itv == NULL)
622 return (copyout(&i32, uap->itv, sizeof(i32)));
626 freebsd32_select(struct thread *td, struct freebsd32_select_args *uap)
632 if (uap->tv != NULL) {
633 error = copyin(uap->tv, &tv32, sizeof(tv32));
644 return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
649 freebsd32_pselect(struct thread *td, struct freebsd32_pselect_args *uap)
657 if (uap->ts != NULL) {
658 error = copyin(uap->ts, &ts32, sizeof(ts32));
667 if (uap->sm != NULL) {
668 error = copyin(uap->sm, &set, sizeof(set));
677 error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp,
683 * Copy 'count' items into the destination list pointed to by uap->eventlist.
688 struct freebsd32_kevent_args *uap;
694 uap = (struct freebsd32_kevent_args *)arg;
720 error = copyout(ks32, uap->eventlist, count * sizeof *ks32);
722 uap->eventlist += count;
727 * Copy 'count' items from the list pointed to by uap->changelist.
732 struct freebsd32_kevent_args *uap;
738 uap = (struct freebsd32_kevent_args *)arg;
740 error = copyin(uap->changelist, ks32, count * sizeof *ks32);
743 uap->changelist += count;
770 freebsd32_kevent(struct thread *td, struct freebsd32_kevent_args *uap)
775 .arg = uap,
780 struct kevent32 *eventlist = uap->eventlist;
784 if (uap->timeout) {
785 error = copyin(uap->timeout, &ts32, sizeof(ts32));
795 ktrstructarray("kevent32", UIO_USERSPACE, uap->changelist,
796 uap->nchanges, sizeof(struct kevent32));
798 error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents,
812 struct freebsd11_freebsd32_kevent_args *uap;
817 uap = (struct freebsd11_freebsd32_kevent_args *)arg;
827 error = copyout(ks32, uap->eventlist, count * sizeof *ks32);
829 uap->eventlist += count;
834 * Copy 'count' items from the list pointed to by uap->changelist.
839 struct freebsd11_freebsd32_kevent_args *uap;
844 uap = (struct freebsd11_freebsd32_kevent_args *)arg;
846 error = copyin(uap->changelist, ks32, count * sizeof *ks32);
849 uap->changelist += count;
867 struct freebsd11_freebsd32_kevent_args *uap)
872 .arg = uap,
877 struct freebsd11_kevent32 *eventlist = uap->eventlist;
881 if (uap->timeout) {
882 error = copyin(uap->timeout, &ts32, sizeof(ts32));
893 uap->changelist, uap->nchanges,
896 error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents,
910 struct freebsd32_gettimeofday_args *uap)
917 if (uap->tp) {
921 error = copyout(&atv32, uap->tp, sizeof (atv32));
923 if (error == 0 && uap->tzp != NULL) {
926 error = copyout(&rtz, uap->tzp, sizeof (rtz));
932 freebsd32_getrusage(struct thread *td, struct freebsd32_getrusage_args *uap)
938 error = kern_getrusage(td, uap->who, &s);
941 error = copyout(&s32, uap->rusage, sizeof(s32));
976 freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap)
1011 AUDIT_ARG_PID(uap->pid);
1012 AUDIT_ARG_CMD(uap->req);
1013 AUDIT_ARG_VALUE(uap->data);
1015 data = uap->data;
1016 switch (uap->req) {
1022 if (uap->data > sizeof(r32.pl))
1030 if (uap->data < offsetof(struct ptrace_lwpinfo32, pl_siginfo) +
1044 error = copyin(uap->addr, &r.reg, sizeof(r.reg));
1047 error = copyin(uap->addr, &r.fpreg, sizeof(r.fpreg));
1050 error = copyin(uap->addr, &r.dbreg, sizeof(r.dbreg));
1054 error = copyin(uap->addr, &r32.vec, sizeof(r32.vec));
1062 if (uap->data != sizeof(r.ptevents))
1065 error = copyin(uap->addr, &r.ptevents, uap->data);
1068 error = copyin(uap->addr, &r32.piod, sizeof(r32.piod));
1077 error = copyin(uap->addr, &r32.pve, sizeof(r32.pve));
1093 if (uap->data != sizeof(r32.pc))
1096 error = copyin(uap->addr, &r32.pc, uap->data);
1103 if (uap->data != sizeof(r32.sr)) {
1107 error = copyin(uap->addr, &r32.sr, uap->data);
1125 addr = uap->addr;
1131 error = kern_ptrace(td, uap->req, uap->pid, addr, data);
1135 switch (uap->req) {
1146 error = copyout(&r32.pve, uap->addr, sizeof(r32.pve));
1150 error = copyout(&r32.piod, uap->addr, sizeof(r32.piod));
1153 error = copyout(&r.reg, uap->addr, sizeof(r.reg));
1156 error = copyout(&r.fpreg, uap->addr, sizeof(r.fpreg));
1159 error = copyout(&r.dbreg, uap->addr, sizeof(r.dbreg));
1163 error = copyout(&r32.vec, uap->addr, sizeof(r32.vec));
1166 /* NB: The size in uap->data is validated in kern_ptrace(). */
1167 error = copyout(&r.ptevents, uap->addr, uap->data);
1171 error = copyout(&r32.pl, uap->addr, uap->data);
1176 error = copyout(r32.args, uap->addr, MIN(uap->data,
1181 error = copyout(&r32.psr, uap->addr, MIN(uap->data,
1186 error = copyout(&r32.sr.pscr_ret, uap->addr +
1234 freebsd32_readv(struct thread *td, struct freebsd32_readv_args *uap)
1239 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
1242 error = kern_readv(td, uap->fd, auio);
1248 freebsd32_writev(struct thread *td, struct freebsd32_writev_args *uap)
1253 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
1256 error = kern_writev(td, uap->fd, auio);
1262 freebsd32_preadv(struct thread *td, struct freebsd32_preadv_args *uap)
1267 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
1270 error = kern_preadv(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
1276 freebsd32_pwritev(struct thread *td, struct freebsd32_pwritev_args *uap)
1281 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
1284 error = kern_pwritev(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset));
1505 freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap)
1513 error = freebsd32_copyinmsghdr(uap->msg, &msg);
1520 msg.msg_flags = uap->flags;
1525 error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, controlp);
1535 error = freebsd32_copyoutmsghdr(&msg, uap->msg);
1550 ofreebsd32_recvmsg(struct thread *td, struct ofreebsd32_recvmsg_args *uap)
1659 freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap)
1667 error = freebsd32_copyinmsghdr(uap->msg, &msg);
1699 error = kern_sendit(td, uap->s, &msg, uap->flags, control,
1711 ofreebsd32_sendmsg(struct thread *td, struct ofreebsd32_sendmsg_args *uap)
1720 struct freebsd32_settimeofday_args *uap)
1727 if (uap->tv) {
1728 error = copyin(uap->tv, &tv32, sizeof(tv32));
1736 if (uap->tzp) {
1737 error = copyin(uap->tzp, &tz, sizeof(tz));
1747 freebsd32_utimes(struct thread *td, struct freebsd32_utimes_args *uap)
1753 if (uap->tptr != NULL) {
1754 error = copyin(uap->tptr, s32, sizeof(s32));
1764 return (kern_utimesat(td, AT_FDCWD, uap->path, UIO_USERSPACE,
1769 freebsd32_lutimes(struct thread *td, struct freebsd32_lutimes_args *uap)
1775 if (uap->tptr != NULL) {
1776 error = copyin(uap->tptr, s32, sizeof(s32));
1786 return (kern_lutimes(td, uap->path, UIO_USERSPACE, sp, UIO_SYSSPACE));
1790 freebsd32_futimes(struct thread *td, struct freebsd32_futimes_args *uap)
1796 if (uap->tptr != NULL) {
1797 error = copyin(uap->tptr, s32, sizeof(s32));
1807 return (kern_futimes(td, uap->fd, sp, UIO_SYSSPACE));
1811 freebsd32_futimesat(struct thread *td, struct freebsd32_futimesat_args *uap)
1817 if (uap->times != NULL) {
1818 error = copyin(uap->times, s32, sizeof(s32));
1828 return (kern_utimesat(td, uap->fd, uap->path, UIO_USERSPACE,
1833 freebsd32_futimens(struct thread *td, struct freebsd32_futimens_args *uap)
1839 if (uap->times != NULL) {
1840 error = copyin(uap->times, ts32, sizeof(ts32));
1850 return (kern_futimens(td, uap->fd, tsp, UIO_SYSSPACE));
1854 freebsd32_utimensat(struct thread *td, struct freebsd32_utimensat_args *uap)
1860 if (uap->times != NULL) {
1861 error = copyin(uap->times, ts32, sizeof(ts32));
1871 return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE,
1872 tsp, UIO_SYSSPACE, uap->flag));
1876 freebsd32_adjtime(struct thread *td, struct freebsd32_adjtime_args *uap)
1882 if (uap->delta) {
1883 error = copyin(uap->delta, &tv32, sizeof(tv32));
1892 if (uap->olddelta && error == 0) {
1895 error = copyout(&tv32, uap->olddelta, sizeof(tv32));
1902 freebsd4_freebsd32_statfs(struct thread *td, struct freebsd4_freebsd32_statfs_args *uap)
1909 error = kern_statfs(td, uap->path, UIO_USERSPACE, sp);
1912 error = copyout(&s32, uap->buf, sizeof(s32));
1921 freebsd4_freebsd32_fstatfs(struct thread *td, struct freebsd4_freebsd32_fstatfs_args *uap)
1928 error = kern_fstatfs(td, uap->fd, sp);
1931 error = copyout(&s32, uap->buf, sizeof(s32));
1940 freebsd4_freebsd32_fhstatfs(struct thread *td, struct freebsd4_freebsd32_fhstatfs_args *uap)
1947 if ((error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t))) != 0)
1953 error = copyout(&s32, uap->buf, sizeof(s32));
1961 freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
1964 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
1965 PAIR32TO64(off_t, uap->offset)));
1969 freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap)
1972 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
1973 PAIR32TO64(off_t, uap->offset)));
1978 ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap)
1981 return (kern_lseek(td, uap->fd, uap->offset, uap->whence));
1986 freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap)
1991 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
1992 uap->whence);
2001 freebsd32_truncate(struct thread *td, struct freebsd32_truncate_args *uap)
2004 return (kern_truncate(td, uap->path, UIO_USERSPACE,
2005 PAIR32TO64(off_t, uap->length)));
2010 ofreebsd32_truncate(struct thread *td, struct ofreebsd32_truncate_args *uap)
2012 return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length));
2017 freebsd32_ftruncate(struct thread *td, struct freebsd32_ftruncate_args *uap)
2020 return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
2025 ofreebsd32_ftruncate(struct thread *td, struct ofreebsd32_ftruncate_args *uap)
2027 return (kern_ftruncate(td, uap->fd, uap->length));
2032 struct ofreebsd32_getdirentries_args *uap)
2039 ap.fd = uap->fd;
2040 ap.buf = uap->buf;
2041 ap.count = uap->count;
2046 error = copyout(&loff_cut, uap->basep, sizeof(int32_t));
2055 struct freebsd11_freebsd32_getdirentries_args *uap)
2061 error = freebsd11_kern_getdirentries(td, uap->fd, uap->buf, uap->count,
2065 if (uap->basep != NULL) {
2067 error = copyout(&base32, uap->basep, sizeof(int32_t));
2076 freebsd6_freebsd32_pread(struct thread *td, struct freebsd6_freebsd32_pread_args *uap)
2079 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte,
2080 PAIR32TO64(off_t, uap->offset)));
2084 freebsd6_freebsd32_pwrite(struct thread *td, struct freebsd6_freebsd32_pwrite_args *uap)
2087 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte,
2088 PAIR32TO64(off_t, uap->offset)));
2092 freebsd6_freebsd32_lseek(struct thread *td, struct freebsd6_freebsd32_lseek_args *uap)
2097 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset),
2098 uap->whence);
2107 freebsd6_freebsd32_truncate(struct thread *td, struct freebsd6_freebsd32_truncate_args *uap)
2110 return (kern_truncate(td, uap->path, UIO_USERSPACE,
2111 PAIR32TO64(off_t, uap->length)));
2115 freebsd6_freebsd32_ftruncate(struct thread *td, struct freebsd6_freebsd32_ftruncate_args *uap)
2118 return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
2131 struct freebsd32_sendfile_args *uap, int compat)
2142 offset = PAIR32TO64(off_t, uap->offset);
2148 if (uap->hdtr != NULL) {
2149 error = copyin(uap->hdtr, &hdtr32, sizeof(hdtr32));
2170 if (uap->nbytes > hdr_uio->uio_resid)
2171 uap->nbytes -= hdr_uio->uio_resid;
2173 uap->nbytes = 0;
2186 AUDIT_ARG_FD(uap->fd);
2188 if ((error = fget_read(td, uap->fd,
2192 error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, offset,
2193 uap->nbytes, &sbytes, uap->flags, td);
2196 if (uap->sbytes != NULL)
2197 (void)copyout(&sbytes, uap->sbytes, sizeof(off_t));
2210 struct freebsd4_freebsd32_sendfile_args *uap)
2213 (struct freebsd32_sendfile_args *)uap, 1));
2218 freebsd32_sendfile(struct thread *td, struct freebsd32_sendfile_args *uap)
2221 return (freebsd32_do_sendfile(td, uap, 0));
2293 ofreebsd32_stat(struct thread *td, struct ofreebsd32_stat_args *uap)
2299 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb);
2303 error = copyout(&sb32, uap->ub, sizeof (sb32));
2309 freebsd32_fstat(struct thread *td, struct freebsd32_fstat_args *uap)
2315 error = kern_fstat(td, uap->fd, &ub);
2319 error = copyout(&ub32, uap->sb, sizeof(ub32));
2325 ofreebsd32_fstat(struct thread *td, struct ofreebsd32_fstat_args *uap)
2331 error = kern_fstat(td, uap->fd, &ub);
2335 error = copyout(&ub32, uap->sb, sizeof(ub32));
2341 freebsd32_fstatat(struct thread *td, struct freebsd32_fstatat_args *uap)
2347 error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE,
2352 error = copyout(&ub32, uap->buf, sizeof(ub32));
2358 ofreebsd32_lstat(struct thread *td, struct ofreebsd32_lstat_args *uap)
2364 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path,
2369 error = copyout(&sb32, uap->ub, sizeof (sb32));
2375 freebsd32_fhstat(struct thread *td, struct freebsd32_fhstat_args *uap)
2382 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t));
2389 error = copyout(&sb32, uap->sb, sizeof (sb32));
2477 struct freebsd11_freebsd32_stat_args *uap)
2483 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb);
2488 error = copyout(&sb32, uap->ub, sizeof (sb32));
2494 struct freebsd11_freebsd32_fstat_args *uap)
2500 error = kern_fstat(td, uap->fd, &sb);
2505 error = copyout(&sb32, uap->sb, sizeof (sb32));
2511 struct freebsd11_freebsd32_fstatat_args *uap)
2517 error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE,
2523 error = copyout(&sb32, uap->buf, sizeof (sb32));
2529 struct freebsd11_freebsd32_lstat_args *uap)
2535 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path,
2541 error = copyout(&sb32, uap->ub, sizeof (sb32));
2547 struct freebsd11_freebsd32_fhstat_args *uap)
2554 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t));
2562 error = copyout(&sb32, uap->sb, sizeof (sb32));
2602 struct freebsd11_freebsd32_nstat_args *uap)
2608 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb);
2613 error = copyout(&nsb, uap->ub, sizeof (nsb));
2619 struct freebsd11_freebsd32_nlstat_args *uap)
2625 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path,
2631 error = copyout(&nsb, uap->ub, sizeof (nsb));
2637 struct freebsd11_freebsd32_nfstat_args *uap)
2643 error = kern_fstat(td, uap->fd, &ub);
2648 error = copyout(&nub, uap->sb, sizeof(nub));
2654 freebsd32___sysctl(struct thread *td, struct freebsd32___sysctl_args *uap)
2660 if (uap->namelen > CTL_MAXNAME || uap->namelen < 2)
2662 error = copyin(uap->name, name, uap->namelen * sizeof(int));
2665 if (uap->oldlenp) {
2666 error = fueword32(uap->oldlenp, &tmp);
2673 error = userland_sysctl(td, name, uap->namelen,
2674 uap->old, &oldlen, 1,
2675 uap->new, uap->newlen, &j, SCTL_MASK32);
2678 if (uap->oldlenp != NULL && suword32(uap->oldlenp, j) != 0)
2685 struct freebsd32___sysctlbyname_args *uap)
2691 if (uap->oldlenp != NULL) {
2692 error = fueword32(uap->oldlenp, &tmp);
2699 error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old,
2700 &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1);
2703 if (uap->oldlenp != NULL && suword32(uap->oldlenp, rv) != 0)
2709 freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap)
2715 error = copyin(uap->jail, &version, sizeof(uint32_t));
2726 error = copyin(uap->jail, &j32_v0, sizeof(struct jail32_v0));
2748 error = copyin(uap->jail, &j32, sizeof(struct jail32));
2770 freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args *uap)
2776 if (uap->iovcnt & 1)
2779 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
2782 error = kern_jail_set(td, auio, uap->flags);
2788 freebsd32_jail_get(struct thread *td, struct freebsd32_jail_get_args *uap)
2795 if (uap->iovcnt & 1)
2798 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
2801 error = kern_jail_get(td, auio, uap->flags);
2803 for (i = 0; i < uap->iovcnt; i++) {
2806 error = copyout(&iov32, uap->iovp + i, sizeof(iov32));
2815 freebsd32_sigaction(struct thread *td, struct freebsd32_sigaction_args *uap)
2821 if (uap->act) {
2822 error = copyin(uap->act, &s32, sizeof(s32));
2831 error = kern_sigaction(td, uap->sig, sap, &osa, 0);
2832 if (error == 0 && uap->oact != NULL) {
2836 error = copyout(&s32, uap->oact, sizeof(s32));
2844 struct freebsd4_freebsd32_sigaction_args *uap)
2850 if (uap->act) {
2851 error = copyin(uap->act, &s32, sizeof(s32));
2860 error = kern_sigaction(td, uap->sig, sap, &osa, KSA_FREEBSD4);
2861 if (error == 0 && uap->oact != NULL) {
2865 error = copyout(&s32, uap->oact, sizeof(s32));
2882 struct ofreebsd32_sigaction_args *uap)
2888 if (uap->signum <= 0 || uap->signum >= ONSIG)
2891 if (uap->nsa) {
2892 error = copyin(uap->nsa, &s32, sizeof(s32));
2901 error = kern_sigaction(td, uap->signum, sap, &osa, KSA_OSIGSET);
2902 if (error == 0 && uap->osa != NULL) {
2906 error = copyout(&s32, uap->osa, sizeof(s32));
2919 struct ofreebsd32_sigvec_args *uap)
2925 if (uap->signum <= 0 || uap->signum >= ONSIG)
2928 if (uap->nsv) {
2929 error = copyin(uap->nsv, &vec, sizeof(vec));
2939 error = kern_sigaction(td, uap->signum, sap, &osa, KSA_OSIGSET);
2940 if (error == 0 && uap->osv != NULL) {
2946 error = copyout(&vec, uap->osv, sizeof(vec));
2958 struct ofreebsd32_sigstack_args *uap)
2964 if (uap->nss != NULL) {
2965 error = copyin(uap->nss, &s32, sizeof(s32));
2982 if (uap->oss != NULL) {
2985 error = copyout(&s32, uap->oss, sizeof(s32));
2992 freebsd32_nanosleep(struct thread *td, struct freebsd32_nanosleep_args *uap)
2996 TIMER_RELTIME, uap->rqtp, uap->rmtp));
3001 struct freebsd32_clock_nanosleep_args *uap)
3005 error = freebsd32_user_clock_nanosleep(td, uap->clock_id, uap->flags,
3006 uap->rqtp, uap->rmtp);
3039 struct freebsd32_clock_gettime_args *uap)
3045 error = kern_clock_gettime(td, uap->clock_id, &ats);
3049 error = copyout(&ats32, uap->tp, sizeof(ats32));
3056 struct freebsd32_clock_settime_args *uap)
3062 error = copyin(uap->tp, &ats32, sizeof(ats32));
3068 return (kern_clock_settime(td, uap->clock_id, &ats));
3073 struct freebsd32_clock_getres_args *uap)
3079 if (uap->tp == NULL)
3081 error = kern_clock_getres(td, uap->clock_id, &ts);
3085 error = copyout(&ts32, uap->tp, sizeof(ts32));
3091 struct freebsd32_ktimer_create_args *uap)
3097 if (uap->evp == NULL) {
3101 error = copyin(uap->evp, &ev32, sizeof(ev32));
3108 error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1);
3110 error = copyout(&id, uap->timerid, sizeof(int));
3119 struct freebsd32_ktimer_settime_args *uap)
3125 error = copyin(uap->value, &val32, sizeof(val32));
3129 ovalp = uap->ovalue != NULL ? &oval : NULL;
3130 error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp);
3131 if (error == 0 && uap->ovalue != NULL) {
3133 error = copyout(&oval32, uap->ovalue, sizeof(oval32));
3140 struct freebsd32_ktimer_gettime_args *uap)
3146 error = kern_ktimer_gettime(td, uap->timerid, &val);
3149 error = copyout(&val32, uap->value, sizeof(val32));
3156 struct freebsd32_timerfd_gettime_args *uap)
3162 error = kern_timerfd_gettime(td, uap->fd, &curr_value);
3168 error = copyout(&curr_value32, uap->curr_value,
3177 struct freebsd32_timerfd_settime_args *uap)
3183 error = copyin(uap->new_value, &new_value32, sizeof(new_value32));
3190 if (uap->old_value == NULL) {
3191 error = kern_timerfd_settime(td, uap->fd, uap->flags,
3194 error = kern_timerfd_settime(td, uap->fd, uap->flags,
3201 error = copyout(&old_value32, uap->old_value,
3210 struct freebsd32_clock_getcpuclockid2_args *uap)
3215 error = kern_clock_getcpuclockid2(td, PAIR32TO64(id_t, uap->id),
3216 uap->which, &clk_id);
3218 error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t));
3224 struct freebsd32_thr_new_args *uap)
3230 if (uap->param_size < 0 ||
3231 uap->param_size > sizeof(struct thr_param32))
3235 error = copyin(uap->param, &param32, uap->param_size);
3256 freebsd32_thr_suspend(struct thread *td, struct freebsd32_thr_suspend_args *uap)
3264 if (uap->timeout != NULL) {
3265 error = copyin((const void *)uap->timeout, (void *)&ts32,
3300 freebsd32_sigqueue(struct thread *td, struct freebsd32_sigqueue_args *uap)
3313 sv.sival_int = (uint32_t)(uint64_t)uap->value;
3315 return (kern_sigqueue(td, uap->pid, uap->signum, &sv));
3319 freebsd32_sigtimedwait(struct thread *td, struct freebsd32_sigtimedwait_args *uap)
3329 if (uap->timeout) {
3330 error = copyin(uap->timeout, &ts32, sizeof(ts32));
3339 error = copyin(uap->set, &set, sizeof(set));
3347 if (uap->info) {
3349 error = copyout(&si32, uap->info, sizeof(struct __siginfo32));
3361 freebsd32_sigwaitinfo(struct thread *td, struct freebsd32_sigwaitinfo_args *uap)
3368 error = copyin(uap->set, &set, sizeof(set));
3376 if (uap->info) {
3378 error = copyout(&si32, uap->info, sizeof(struct __siginfo32));
3387 struct freebsd32_cpuset_setid_args *uap)
3390 return (kern_cpuset_setid(td, uap->which,
3391 PAIR32TO64(id_t, uap->id), uap->setid));
3396 struct freebsd32_cpuset_getid_args *uap)
3399 return (kern_cpuset_getid(td, uap->level, uap->which,
3400 PAIR32TO64(id_t, uap->id), uap->setid));
3463 struct freebsd32_cpuset_getaffinity_args *uap)
3466 return (user_cpuset_getaffinity(td, uap->level, uap->which,
3467 PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask,
3473 struct freebsd32_cpuset_setaffinity_args *uap)
3476 return (user_cpuset_setaffinity(td, uap->level, uap->which,
3477 PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask,
3483 struct freebsd32_cpuset_getdomain_args *uap)
3486 return (kern_cpuset_getdomain(td, uap->level, uap->which,
3487 PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy,
3493 struct freebsd32_cpuset_setdomain_args *uap)
3496 return (kern_cpuset_setdomain(td, uap->level, uap->which,
3497 PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy,
3507 } */ *uap)
3518 flags = uap->flags;
3535 if ((uap->iovcnt & 1) || (uap->iovcnt < 4))
3538 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio);
3549 freebsd32_xxx(struct thread *td, struct freebsd32_xxx_args *uap)
3556 if (uap->zzz) {
3557 error = copyin(uap->zzz, &s32, sizeof(s32));
3566 if (uap->zzz) {
3759 freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
3765 if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
3774 error = kern_kldstat(td, uap->fileid, stat);
3784 error = copyout(stat32, uap->stat, version);
3793 struct freebsd32_posix_fallocate_args *uap)
3797 error = kern_posix_fallocate(td, uap->fd,
3798 PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len));
3804 struct freebsd32_posix_fadvise_args *uap)
3808 error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset),
3809 PAIR32TO64(off_t, uap->len), uap->advice);
3840 freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
3853 if (uap->com >= PROC_PROCCTL_MD_MIN)
3854 return (cpu_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id),
3855 uap->com, PTRIN(uap->data)));
3857 switch (uap->com) {
3867 error = copyin(PTRIN(uap->data), &flags, sizeof(flags));
3874 if (uap->data != NULL)
3882 error = copyin(uap->data, &x32.rp, sizeof(x32.rp));
3890 error = copyin(uap->data, &x.rk, sizeof(x.rk));
3906 error = copyin(uap->data, &signum, sizeof(signum));
3917 error = kern_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id),
3918 uap->com, data);
3919 switch (uap->com) {
3922 error = copyout(&x.rs, uap->data, sizeof(x.rs));
3925 error1 = copyout(&x.rk, uap->data, sizeof(x.rk));
3938 error = copyout(&flags, uap->data, sizeof(flags));
3942 error = copyout(&signum, uap->data, sizeof(signum));
3949 freebsd32_fcntl(struct thread *td, struct freebsd32_fcntl_args *uap)
3953 switch (uap->cmd) {
3968 tmp = (unsigned int)(uap->arg);
3971 tmp = uap->arg;
3974 return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp));
3978 freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap)
3985 if (uap->ts != NULL) {
3986 error = copyin(uap->ts, &ts32, sizeof(ts32));
3994 if (uap->set != NULL) {
3995 error = copyin(uap->set, &set, sizeof(set));
4002 return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp));
4007 struct freebsd32_sched_rr_get_interval_args *uap)
4013 error = kern_sched_rr_get_interval(td, uap->pid, &ts);
4017 error = copyout(&ts32, uap->interval, sizeof(ts32));
4067 freebsd32_ntp_adjtime(struct thread *td, struct freebsd32_ntp_adjtime_args *uap)
4073 error = copyin(uap->tp, &tx32, sizeof(tx32));
4079 error = copyout(&tx32, uap->tp, sizeof(tx32));
4094 struct freebsd32_ffclock_setestimate_args *uap)
4104 if ((error = copyin(uap->cest, &cest32,
4128 struct freebsd32_ffclock_getestimate_args *uap)
4149 error = copyout(&cest32, uap->cest, sizeof(struct ffclock_estimate32));
4155 struct freebsd32_ffclock_setestimate_args *uap)
4162 struct freebsd32_ffclock_getestimate_args *uap)
4170 ofreebsd32_sethostid(struct thread *td, struct ofreebsd32_sethostid_args *uap)
4175 hostid = uap->hostid;
4182 freebsd32_setcred(struct thread *td, struct freebsd32_setcred_args *uap)
4185 return (user_setcred(td, uap->flags, uap->wcred, uap->size, true));