Lines Matching +full:ats +full:- +full:supported

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
136 FEATURE_ADD("compat_freebsd32", "Compatible with 32-bit FreeBSD"); in register_compat32_feature()
138 "Compatible with 32-bit FreeBSD (legacy feature name)"); in register_compat32_feature()
231 if (uap->rusage != NULL) in freebsd32_wait4()
235 error = kern_wait(td, uap->pid, &status, uap->options, rup); in freebsd32_wait4()
238 if (uap->status != NULL) in freebsd32_wait4()
239 error = copyout(&status, uap->status, sizeof(status)); in freebsd32_wait4()
240 if (uap->rusage != NULL && error == 0) { in freebsd32_wait4()
242 error = copyout(&ru32, uap->rusage, sizeof(ru32)); in freebsd32_wait4()
256 if (uap->wrusage != NULL) in freebsd32_wait6()
260 if (uap->info != NULL) { in freebsd32_wait6()
265 error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id), in freebsd32_wait6()
266 &status, uap->options, wrup, sip); in freebsd32_wait6()
269 if (uap->status != NULL) in freebsd32_wait6()
270 error = copyout(&status, uap->status, sizeof(status)); in freebsd32_wait6()
271 if (uap->wrusage != NULL && error == 0) { in freebsd32_wait6()
274 error = copyout(&wru32, uap->wrusage, sizeof(wru32)); in freebsd32_wait6()
276 if (uap->info != NULL && error == 0) { in freebsd32_wait6()
278 error = copyout(&si32, uap->info, sizeof(si32)); in freebsd32_wait6()
291 out->f_iosize = MIN(in->f_iosize, INT32_MAX); in copy_statfs()
295 out->f_files = MIN(in->f_files, INT32_MAX); in copy_statfs()
296 out->f_ffree = MIN(in->f_ffree, INT32_MAX); in copy_statfs()
301 out->f_syncwrites = MIN(in->f_syncwrites, INT32_MAX); in copy_statfs()
302 out->f_asyncwrites = MIN(in->f_asyncwrites, INT32_MAX); in copy_statfs()
303 strlcpy(out->f_fstypename, in copy_statfs()
304 in->f_fstypename, MFSNAMELEN); in copy_statfs()
305 strlcpy(out->f_mntonname, in copy_statfs()
306 in->f_mntonname, min(MNAMELEN, FREEBSD4_OMNAMELEN)); in copy_statfs()
307 out->f_syncreads = MIN(in->f_syncreads, INT32_MAX); in copy_statfs()
308 out->f_asyncreads = MIN(in->f_asyncreads, INT32_MAX); in copy_statfs()
309 strlcpy(out->f_mntfromname, in copy_statfs()
310 in->f_mntfromname, min(MNAMELEN, FREEBSD4_OMNAMELEN)); in copy_statfs()
320 if (uap->bufsize < 0 || uap->bufsize > SIZE_MAX) in freebsd32_getfsstat()
322 error = kern_getfsstat(td, &uap->buf, uap->bufsize, &count, in freebsd32_getfsstat()
323 UIO_USERSPACE, uap->mode); in freebsd32_getfsstat()
325 td->td_retval[0] = count; in freebsd32_getfsstat()
339 count = uap->bufsize / sizeof(struct ostatfs32); in freebsd4_freebsd32_getfsstat()
341 error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->mode); in freebsd4_freebsd32_getfsstat()
347 error = copyout(&stat32, uap->buf, sizeof(stat32)); in freebsd4_freebsd32_getfsstat()
349 uap->buf++; in freebsd4_freebsd32_getfsstat()
350 copycount--; in freebsd4_freebsd32_getfsstat()
355 td->td_retval[0] = count; in freebsd4_freebsd32_getfsstat()
365 return(kern_freebsd11_getfsstat(td, uap->buf, uap->bufsize, in freebsd11_freebsd32_getfsstat()
366 uap->mode)); in freebsd11_freebsd32_getfsstat()
378 if (uap->ss != NULL) { in freebsd32_sigaltstack()
379 error = copyin(uap->ss, &s32, sizeof(s32)); in freebsd32_sigaltstack()
389 if (error == 0 && uap->oss != NULL) { in freebsd32_sigaltstack()
393 error = copyout(&s32, uap->oss, sizeof(s32)); in freebsd32_sigaltstack()
415 * Allocate demand-paged memory for the file name, argument, and in freebsd32_exec_copyin_args()
480 error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE, in freebsd32_execve()
481 uap->argv, uap->envv); in freebsd32_execve()
500 uap->argv, uap->envv); in freebsd32_fexecve()
502 eargs.fd = uap->fd; in freebsd32_fexecve()
514 return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, in freebsd32_mknodat()
515 uap->mode, PAIR32TO64(dev_t, uap->dev))); in freebsd32_mknodat()
523 prot = uap->prot; in freebsd32_mprotect()
528 return (kern_mprotect(td, (uintptr_t)PTRIN(uap->addr), uap->len, in freebsd32_mprotect()
537 prot = uap->prot; in freebsd32_mmap()
544 .mr_hint = (uintptr_t)uap->addr, in freebsd32_mmap()
545 .mr_len = uap->len, in freebsd32_mmap()
547 .mr_flags = uap->flags, in freebsd32_mmap()
548 .mr_fd = uap->fd, in freebsd32_mmap()
549 .mr_pos = PAIR32TO64(off_t, uap->pos), in freebsd32_mmap()
560 prot = uap->prot; in freebsd6_freebsd32_mmap()
567 .mr_hint = (uintptr_t)uap->addr, in freebsd6_freebsd32_mmap()
568 .mr_len = uap->len, in freebsd6_freebsd32_mmap()
570 .mr_flags = uap->flags, in freebsd6_freebsd32_mmap()
571 .mr_fd = uap->fd, in freebsd6_freebsd32_mmap()
572 .mr_pos = PAIR32TO64(off_t, uap->pos), in freebsd6_freebsd32_mmap()
581 return (kern_ommap(td, (uintptr_t)uap->addr, uap->len, uap->prot, in ofreebsd32_mmap()
582 uap->flags, uap->fd, uap->pos)); in ofreebsd32_mmap()
593 if (uap->itv != NULL) { in freebsd32_setitimer()
594 error = copyin(uap->itv, &i32, sizeof(i32)); in freebsd32_setitimer()
602 error = kern_setitimer(td, uap->which, itvp, &oitv); in freebsd32_setitimer()
603 if (error || uap->oitv == NULL) in freebsd32_setitimer()
607 return (copyout(&i32, uap->oitv, sizeof(i32))); in freebsd32_setitimer()
617 error = kern_getitimer(td, uap->which, &itv); in freebsd32_getitimer()
618 if (error || uap->itv == NULL) in freebsd32_getitimer()
622 return (copyout(&i32, uap->itv, sizeof(i32))); in freebsd32_getitimer()
632 if (uap->tv != NULL) { in freebsd32_select()
633 error = copyin(uap->tv, &tv32, sizeof(tv32)); in freebsd32_select()
644 return (kern_select(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, in freebsd32_select()
657 if (uap->ts != NULL) { in freebsd32_pselect()
658 error = copyin(uap->ts, &ts32, sizeof(ts32)); in freebsd32_pselect()
667 if (uap->sm != NULL) { in freebsd32_pselect()
668 error = copyin(uap->sm, &set, sizeof(set)); in freebsd32_pselect()
677 error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, in freebsd32_pselect()
683 * Copy 'count' items into the destination list pointed to by uap->eventlist.
709 for (j = 0; j < nitems(kevp->ext); j++) { in freebsd32_kevent_copyout()
720 error = copyout(ks32, uap->eventlist, count * sizeof *ks32); in freebsd32_kevent_copyout()
722 uap->eventlist += count; in freebsd32_kevent_copyout()
727 * Copy 'count' items from the list pointed to by uap->changelist.
740 error = copyin(uap->changelist, ks32, count * sizeof *ks32); in freebsd32_kevent_copyin()
743 uap->changelist += count; in freebsd32_kevent_copyin()
752 for (j = 0; j < nitems(kevp->ext); j++) { in freebsd32_kevent_copyin()
780 struct kevent32 *eventlist = uap->eventlist; in freebsd32_kevent()
784 if (uap->timeout) { in freebsd32_kevent()
785 error = copyin(uap->timeout, &ts32, sizeof(ts32)); in freebsd32_kevent()
795 ktrstructarray("kevent32", UIO_USERSPACE, uap->changelist, in freebsd32_kevent()
796 uap->nchanges, sizeof(struct kevent32)); in freebsd32_kevent()
798 error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, in freebsd32_kevent()
803 td->td_retval[0], sizeof(struct kevent32)); in freebsd32_kevent()
827 error = copyout(ks32, uap->eventlist, count * sizeof *ks32); in freebsd32_kevent11_copyout()
829 uap->eventlist += count; in freebsd32_kevent11_copyout()
834 * Copy 'count' items from the list pointed to by uap->changelist.
846 error = copyin(uap->changelist, ks32, count * sizeof *ks32); in freebsd32_kevent11_copyin()
849 uap->changelist += count; in freebsd32_kevent11_copyin()
858 for (j = 0; j < nitems(kevp->ext); j++) in freebsd32_kevent11_copyin()
877 struct freebsd11_kevent32 *eventlist = uap->eventlist; in freebsd11_freebsd32_kevent()
881 if (uap->timeout) { in freebsd11_freebsd32_kevent()
882 error = copyin(uap->timeout, &ts32, sizeof(ts32)); in freebsd11_freebsd32_kevent()
893 uap->changelist, uap->nchanges, in freebsd11_freebsd32_kevent()
896 error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, in freebsd11_freebsd32_kevent()
901 eventlist, td->td_retval[0], in freebsd11_freebsd32_kevent()
917 if (uap->tp) { in freebsd32_gettimeofday()
921 error = copyout(&atv32, uap->tp, sizeof (atv32)); in freebsd32_gettimeofday()
923 if (error == 0 && uap->tzp != NULL) { in freebsd32_gettimeofday()
926 error = copyout(&rtz, uap->tzp, sizeof (rtz)); in freebsd32_gettimeofday()
938 error = kern_getrusage(td, uap->who, &s); in freebsd32_getrusage()
941 error = copyout(&s32, uap->rusage, sizeof(s32)); in freebsd32_getrusage()
952 pl32->pl_lwpid = pl->pl_lwpid; in ptrace_lwpinfo_to32()
953 pl32->pl_event = pl->pl_event; in ptrace_lwpinfo_to32()
954 pl32->pl_flags = pl->pl_flags; in ptrace_lwpinfo_to32()
955 pl32->pl_sigmask = pl->pl_sigmask; in ptrace_lwpinfo_to32()
956 pl32->pl_siglist = pl->pl_siglist; in ptrace_lwpinfo_to32()
957 siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); in ptrace_lwpinfo_to32()
958 strcpy(pl32->pl_tdname, pl->pl_tdname); in ptrace_lwpinfo_to32()
959 pl32->pl_child_pid = pl->pl_child_pid; in ptrace_lwpinfo_to32()
960 pl32->pl_syscall_code = pl->pl_syscall_code; in ptrace_lwpinfo_to32()
961 pl32->pl_syscall_narg = pl->pl_syscall_narg; in ptrace_lwpinfo_to32()
970 psr32->sr_retval[0] = psr->sr_retval[0]; in ptrace_sc_ret_to32()
971 psr32->sr_retval[1] = psr->sr_retval[1]; in ptrace_sc_ret_to32()
972 psr32->sr_error = psr->sr_error; in ptrace_sc_ret_to32()
988 register_t args[nitems(td->td_sa.args)]; in freebsd32_ptrace()
998 uint32_t args[nitems(td->td_sa.args)]; in freebsd32_ptrace()
1002 syscallarg_t pscr_args[nitems(td->td_sa.args)]; in freebsd32_ptrace()
1003 u_int pscr_args32[nitems(td->td_sa.args)]; in freebsd32_ptrace()
1011 AUDIT_ARG_PID(uap->pid); in freebsd32_ptrace()
1012 AUDIT_ARG_CMD(uap->req); in freebsd32_ptrace()
1013 AUDIT_ARG_VALUE(uap->data); in freebsd32_ptrace()
1015 data = uap->data; in freebsd32_ptrace()
1016 switch (uap->req) { in freebsd32_ptrace()
1022 if (uap->data > sizeof(r32.pl)) in freebsd32_ptrace()
1030 if (uap->data < offsetof(struct ptrace_lwpinfo32, pl_siginfo) + in freebsd32_ptrace()
1044 error = copyin(uap->addr, &r.reg, sizeof(r.reg)); in freebsd32_ptrace()
1047 error = copyin(uap->addr, &r.fpreg, sizeof(r.fpreg)); in freebsd32_ptrace()
1050 error = copyin(uap->addr, &r.dbreg, sizeof(r.dbreg)); in freebsd32_ptrace()
1054 error = copyin(uap->addr, &r32.vec, sizeof(r32.vec)); in freebsd32_ptrace()
1062 if (uap->data != sizeof(r.ptevents)) in freebsd32_ptrace()
1065 error = copyin(uap->addr, &r.ptevents, uap->data); in freebsd32_ptrace()
1068 error = copyin(uap->addr, &r32.piod, sizeof(r32.piod)); in freebsd32_ptrace()
1077 error = copyin(uap->addr, &r32.pve, sizeof(r32.pve)); in freebsd32_ptrace()
1093 if (uap->data != sizeof(r32.pc)) in freebsd32_ptrace()
1096 error = copyin(uap->addr, &r32.pc, uap->data); in freebsd32_ptrace()
1103 if (uap->data != sizeof(r32.sr)) { in freebsd32_ptrace()
1107 error = copyin(uap->addr, &r32.sr, uap->data); in freebsd32_ptrace()
1112 if (r.sr.pscr_nargs > nitems(td->td_sa.args)) { in freebsd32_ptrace()
1125 addr = uap->addr; in freebsd32_ptrace()
1131 error = kern_ptrace(td, uap->req, uap->pid, addr, data); in freebsd32_ptrace()
1135 switch (uap->req) { in freebsd32_ptrace()
1146 error = copyout(&r32.pve, uap->addr, sizeof(r32.pve)); in freebsd32_ptrace()
1150 error = copyout(&r32.piod, uap->addr, sizeof(r32.piod)); in freebsd32_ptrace()
1153 error = copyout(&r.reg, uap->addr, sizeof(r.reg)); in freebsd32_ptrace()
1156 error = copyout(&r.fpreg, uap->addr, sizeof(r.fpreg)); in freebsd32_ptrace()
1159 error = copyout(&r.dbreg, uap->addr, sizeof(r.dbreg)); in freebsd32_ptrace()
1163 error = copyout(&r32.vec, uap->addr, sizeof(r32.vec)); in freebsd32_ptrace()
1166 /* NB: The size in uap->data is validated in kern_ptrace(). */ in freebsd32_ptrace()
1167 error = copyout(&r.ptevents, uap->addr, uap->data); in freebsd32_ptrace()
1171 error = copyout(&r32.pl, uap->addr, uap->data); in freebsd32_ptrace()
1176 error = copyout(r32.args, uap->addr, MIN(uap->data, in freebsd32_ptrace()
1181 error = copyout(&r32.psr, uap->addr, MIN(uap->data, in freebsd32_ptrace()
1186 error = copyout(&r32.sr.pscr_ret, uap->addr + in freebsd32_ptrace()
1207 iov = uio->uio_iov; in freebsd32_copyinuio()
1217 uio->uio_iovcnt = iovcnt; in freebsd32_copyinuio()
1218 uio->uio_segflg = UIO_USERSPACE; in freebsd32_copyinuio()
1219 uio->uio_offset = -1; in freebsd32_copyinuio()
1220 uio->uio_resid = 0; in freebsd32_copyinuio()
1222 if (iov->iov_len > INT_MAX - uio->uio_resid) { in freebsd32_copyinuio()
1226 uio->uio_resid += iov->iov_len; in freebsd32_copyinuio()
1239 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_readv()
1242 error = kern_readv(td, uap->fd, auio); in freebsd32_readv()
1253 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_writev()
1256 error = kern_writev(td, uap->fd, auio); in freebsd32_writev()
1267 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_preadv()
1270 error = kern_preadv(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset)); in freebsd32_preadv()
1281 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_pwritev()
1284 error = kern_pwritev(td, uap->fd, auio, PAIR32TO64(off_t,uap->offset)); in freebsd32_pwritev()
1325 msg->msg_name = PTRIN(m32.msg_name); in freebsd32_copyinmsghdr()
1326 msg->msg_namelen = m32.msg_namelen; in freebsd32_copyinmsghdr()
1327 msg->msg_iov = PTRIN(m32.msg_iov); in freebsd32_copyinmsghdr()
1328 msg->msg_iovlen = m32.msg_iovlen; in freebsd32_copyinmsghdr()
1329 msg->msg_control = PTRIN(m32.msg_control); in freebsd32_copyinmsghdr()
1330 msg->msg_controllen = m32.msg_controllen; in freebsd32_copyinmsghdr()
1331 msg->msg_flags = m32.msg_flags; in freebsd32_copyinmsghdr()
1341 m32.msg_name = PTROUT(msg->msg_name); in freebsd32_copyoutmsghdr()
1342 m32.msg_namelen = msg->msg_namelen; in freebsd32_copyoutmsghdr()
1343 m32.msg_iov = PTROUT(msg->msg_iov); in freebsd32_copyoutmsghdr()
1344 m32.msg_iovlen = msg->msg_iovlen; in freebsd32_copyoutmsghdr()
1345 m32.msg_control = PTROUT(msg->msg_control); in freebsd32_copyoutmsghdr()
1346 m32.msg_controllen = msg->msg_controllen; in freebsd32_copyoutmsghdr()
1347 m32.msg_flags = msg->msg_flags; in freebsd32_copyoutmsghdr()
1352 #define FREEBSD32_ALIGNBYTES (sizeof(int) - 1)
1379 switch (cm->cmsg_level) { in freebsd32_cmsg_convert()
1381 switch (cm->cmsg_type) { in freebsd32_cmsg_convert()
1427 len = msg->msg_controllen; in freebsd32_copy_msg_out()
1428 msg->msg_controllen = 0; in freebsd32_copy_msg_out()
1430 ctlbuf = msg->msg_control; in freebsd32_copy_msg_out()
1431 for (m = control; m != NULL && len > 0; m = m->m_next) { in freebsd32_copy_msg_out()
1433 clen = m->m_len; in freebsd32_copy_msg_out()
1436 cm->cmsg_len > clen) { in freebsd32_copy_msg_out()
1442 datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; in freebsd32_copy_msg_out()
1452 msg->msg_flags |= MSG_CTRUNC; in freebsd32_copy_msg_out()
1456 oldclen = cm->cmsg_len; in freebsd32_copy_msg_out()
1457 cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + in freebsd32_copy_msg_out()
1460 cm->cmsg_len = oldclen; in freebsd32_copy_msg_out()
1465 len -= FREEBSD32_ALIGN(copylen); in freebsd32_copy_msg_out()
1469 msg->msg_flags |= MSG_CTRUNC; in freebsd32_copy_msg_out()
1480 len -= FREEBSD32_ALIGN(copylen); in freebsd32_copy_msg_out()
1483 clen -= CMSG_SPACE(datalen); in freebsd32_copy_msg_out()
1491 msg->msg_controllen += in freebsd32_copy_msg_out()
1496 msg->msg_flags |= MSG_CTRUNC; in freebsd32_copy_msg_out()
1513 error = freebsd32_copyinmsghdr(uap->msg, &msg); in freebsd32_recvmsg()
1520 msg.msg_flags = uap->flags; in freebsd32_recvmsg()
1525 error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, controlp); in freebsd32_recvmsg()
1535 error = freebsd32_copyoutmsghdr(&msg, uap->msg); in freebsd32_recvmsg()
1557 * Copy-in the array of control messages constructed using alignment
1558 * and padding suitable for a 32-bit environment and construct an
1559 * mbuf using alignment and padding suitable for a 64-bit kernel.
1583 * required for 64 bit-aligned copies of the control messages. in freebsd32_copyin_control()
1593 if (cm->cmsg_len < FREEBSD32_ALIGN(sizeof(*cm)) || in freebsd32_copyin_control()
1594 cm->cmsg_len > buflen) { in freebsd32_copyin_control()
1598 msglen = FREEBSD32_ALIGN(cm->cmsg_len); in freebsd32_copyin_control()
1599 if (msglen < cm->cmsg_len) { in freebsd32_copyin_control()
1606 buflen -= msglen; in freebsd32_copyin_control()
1610 CMSG_ALIGN(msglen - FREEBSD32_ALIGN(sizeof(*cm))); in freebsd32_copyin_control()
1616 * Allocate up to MJUMPAGESIZE space for the re-aligned and in freebsd32_copyin_control()
1617 * re-padded control messages. This allows a full MCLBYTES of in freebsd32_copyin_control()
1618 * 32-bit sized and aligned messages to fit and avoids an ABI in freebsd32_copyin_control()
1626 m->m_len = outlen; in freebsd32_copyin_control()
1638 msglen = cm->cmsg_len - FREEBSD32_ALIGN(sizeof(*cm)); in freebsd32_copyin_control()
1639 cm->cmsg_len = CMSG_ALIGN(sizeof(*cm)) + msglen; in freebsd32_copyin_control()
1649 outlen -= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen); in freebsd32_copyin_control()
1667 error = freebsd32_copyinmsghdr(uap->msg, &msg); in freebsd32_sendmsg()
1699 error = kern_sendit(td, uap->s, &msg, uap->flags, control, in freebsd32_sendmsg()
1727 if (uap->tv) { in freebsd32_settimeofday()
1728 error = copyin(uap->tv, &tv32, sizeof(tv32)); in freebsd32_settimeofday()
1736 if (uap->tzp) { in freebsd32_settimeofday()
1737 error = copyin(uap->tzp, &tz, sizeof(tz)); in freebsd32_settimeofday()
1753 if (uap->tptr != NULL) { in freebsd32_utimes()
1754 error = copyin(uap->tptr, s32, sizeof(s32)); in freebsd32_utimes()
1764 return (kern_utimesat(td, AT_FDCWD, uap->path, UIO_USERSPACE, in freebsd32_utimes()
1775 if (uap->tptr != NULL) { in freebsd32_lutimes()
1776 error = copyin(uap->tptr, s32, sizeof(s32)); in freebsd32_lutimes()
1786 return (kern_lutimes(td, uap->path, UIO_USERSPACE, sp, UIO_SYSSPACE)); in freebsd32_lutimes()
1796 if (uap->tptr != NULL) { in freebsd32_futimes()
1797 error = copyin(uap->tptr, s32, sizeof(s32)); in freebsd32_futimes()
1807 return (kern_futimes(td, uap->fd, sp, UIO_SYSSPACE)); in freebsd32_futimes()
1817 if (uap->times != NULL) { in freebsd32_futimesat()
1818 error = copyin(uap->times, s32, sizeof(s32)); in freebsd32_futimesat()
1828 return (kern_utimesat(td, uap->fd, uap->path, UIO_USERSPACE, in freebsd32_futimesat()
1839 if (uap->times != NULL) { in freebsd32_futimens()
1840 error = copyin(uap->times, ts32, sizeof(ts32)); in freebsd32_futimens()
1850 return (kern_futimens(td, uap->fd, tsp, UIO_SYSSPACE)); in freebsd32_futimens()
1860 if (uap->times != NULL) { in freebsd32_utimensat()
1861 error = copyin(uap->times, ts32, sizeof(ts32)); in freebsd32_utimensat()
1871 return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE, in freebsd32_utimensat()
1872 tsp, UIO_SYSSPACE, uap->flag)); in freebsd32_utimensat()
1882 if (uap->delta) { in freebsd32_adjtime()
1883 error = copyin(uap->delta, &tv32, sizeof(tv32)); in freebsd32_adjtime()
1892 if (uap->olddelta && error == 0) { in freebsd32_adjtime()
1895 error = copyout(&tv32, uap->olddelta, sizeof(tv32)); in freebsd32_adjtime()
1909 error = kern_statfs(td, uap->path, UIO_USERSPACE, sp); in freebsd4_freebsd32_statfs()
1912 error = copyout(&s32, uap->buf, sizeof(s32)); in freebsd4_freebsd32_statfs()
1928 error = kern_fstatfs(td, uap->fd, sp); in freebsd4_freebsd32_fstatfs()
1931 error = copyout(&s32, uap->buf, sizeof(s32)); in freebsd4_freebsd32_fstatfs()
1947 if ((error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t))) != 0) in freebsd4_freebsd32_fhstatfs()
1953 error = copyout(&s32, uap->buf, sizeof(s32)); in freebsd4_freebsd32_fhstatfs()
1964 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, in freebsd32_pread()
1965 PAIR32TO64(off_t, uap->offset))); in freebsd32_pread()
1972 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, in freebsd32_pwrite()
1973 PAIR32TO64(off_t, uap->offset))); in freebsd32_pwrite()
1981 return (kern_lseek(td, uap->fd, uap->offset, uap->whence)); in ofreebsd32_lseek()
1991 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset), in freebsd32_lseek()
1992 uap->whence); in freebsd32_lseek()
1994 pos = td->td_uretoff.tdu_off; in freebsd32_lseek()
1995 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ in freebsd32_lseek()
1996 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */ in freebsd32_lseek()
2004 return (kern_truncate(td, uap->path, UIO_USERSPACE, in freebsd32_truncate()
2005 PAIR32TO64(off_t, uap->length))); in freebsd32_truncate()
2012 return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length)); in ofreebsd32_truncate()
2020 return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length))); in freebsd32_ftruncate()
2027 return (kern_ftruncate(td, uap->fd, uap->length)); in ofreebsd32_ftruncate()
2039 ap.fd = uap->fd; in ofreebsd32_getdirentries()
2040 ap.buf = uap->buf; in ofreebsd32_getdirentries()
2041 ap.count = uap->count; in ofreebsd32_getdirentries()
2046 error = copyout(&loff_cut, uap->basep, sizeof(int32_t)); in ofreebsd32_getdirentries()
2061 error = freebsd11_kern_getdirentries(td, uap->fd, uap->buf, uap->count, in freebsd11_freebsd32_getdirentries()
2065 if (uap->basep != NULL) { in freebsd11_freebsd32_getdirentries()
2067 error = copyout(&base32, uap->basep, sizeof(int32_t)); in freebsd11_freebsd32_getdirentries()
2079 return (kern_pread(td, uap->fd, uap->buf, uap->nbyte, in freebsd6_freebsd32_pread()
2080 PAIR32TO64(off_t, uap->offset))); in freebsd6_freebsd32_pread()
2087 return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, in freebsd6_freebsd32_pwrite()
2088 PAIR32TO64(off_t, uap->offset))); in freebsd6_freebsd32_pwrite()
2097 error = kern_lseek(td, uap->fd, PAIR32TO64(off_t, uap->offset), in freebsd6_freebsd32_lseek()
2098 uap->whence); in freebsd6_freebsd32_lseek()
2100 pos = *(off_t *)(td->td_retval); in freebsd6_freebsd32_lseek()
2101 td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ in freebsd6_freebsd32_lseek()
2102 td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */ in freebsd6_freebsd32_lseek()
2110 return (kern_truncate(td, uap->path, UIO_USERSPACE, in freebsd6_freebsd32_truncate()
2111 PAIR32TO64(off_t, uap->length))); in freebsd6_freebsd32_truncate()
2118 return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length))); in freebsd6_freebsd32_ftruncate()
2142 offset = PAIR32TO64(off_t, uap->offset); in freebsd32_do_sendfile()
2148 if (uap->hdtr != NULL) { in freebsd32_do_sendfile()
2149 error = copyin(uap->hdtr, &hdtr32, sizeof(hdtr32)); in freebsd32_do_sendfile()
2170 if (uap->nbytes > hdr_uio->uio_resid) in freebsd32_do_sendfile()
2171 uap->nbytes -= hdr_uio->uio_resid; in freebsd32_do_sendfile()
2173 uap->nbytes = 0; in freebsd32_do_sendfile()
2186 AUDIT_ARG_FD(uap->fd); in freebsd32_do_sendfile()
2188 if ((error = fget_read(td, uap->fd, in freebsd32_do_sendfile()
2192 error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, offset, in freebsd32_do_sendfile()
2193 uap->nbytes, &sbytes, uap->flags, td); in freebsd32_do_sendfile()
2196 if (uap->sbytes != NULL) in freebsd32_do_sendfile()
2197 (void)copyout(&sbytes, uap->sbytes, sizeof(off_t)); in freebsd32_do_sendfile()
2230 * 32-bit architectures other than i386 have 64-bit time_t. This in copy_stat()
2234 bzero(&out->st_atim, sizeof(out->st_atim)); in copy_stat()
2235 bzero(&out->st_mtim, sizeof(out->st_mtim)); in copy_stat()
2236 bzero(&out->st_ctim, sizeof(out->st_ctim)); in copy_stat()
2237 bzero(&out->st_birthtim, sizeof(out->st_birthtim)); in copy_stat()
2255 out->st_padding0 = 0; in copy_stat()
2256 out->st_padding1 = 0; in copy_stat()
2258 out->st_atim_ext = 0; in copy_stat()
2259 out->st_mtim_ext = 0; in copy_stat()
2260 out->st_ctim_ext = 0; in copy_stat()
2261 out->st_btim_ext = 0; in copy_stat()
2263 bzero(out->st_spare, sizeof(out->st_spare)); in copy_stat()
2279 out->st_size = MIN(in->st_size, INT32_MAX); in copy_ostat()
2298 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb); in ofreebsd32_stat()
2302 error = copyout(&sb32, uap->ub, sizeof (sb32)); in ofreebsd32_stat()
2314 error = kern_fstat(td, uap->fd, &ub); in freebsd32_fstat()
2318 error = copyout(&ub32, uap->sb, sizeof(ub32)); in freebsd32_fstat()
2330 error = kern_fstat(td, uap->fd, &ub); in ofreebsd32_fstat()
2334 error = copyout(&ub32, uap->sb, sizeof(ub32)); in ofreebsd32_fstat()
2346 error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE, in freebsd32_fstatat()
2351 error = copyout(&ub32, uap->buf, sizeof(ub32)); in freebsd32_fstatat()
2363 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path, in ofreebsd32_lstat()
2368 error = copyout(&sb32, uap->ub, sizeof (sb32)); in ofreebsd32_lstat()
2381 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); in freebsd32_fhstat()
2388 error = copyout(&sb32, uap->sb, sizeof (sb32)); in freebsd32_fhstat()
2401 * 32-bit architectures other than i386 have 64-bit time_t. This in freebsd11_cvtstat32()
2405 bzero(&out->st_atim, sizeof(out->st_atim)); in freebsd11_cvtstat32()
2406 bzero(&out->st_mtim, sizeof(out->st_mtim)); in freebsd11_cvtstat32()
2407 bzero(&out->st_ctim, sizeof(out->st_ctim)); in freebsd11_cvtstat32()
2408 bzero(&out->st_birthtim, sizeof(out->st_birthtim)); in freebsd11_cvtstat32()
2412 if (in->st_ino != out->st_ino) { in freebsd11_cvtstat32()
2420 out->st_ino = UINT32_MAX; in freebsd11_cvtstat32()
2425 if (in->st_nlink != out->st_nlink) { in freebsd11_cvtstat32()
2433 out->st_nlink = UINT16_MAX; in freebsd11_cvtstat32()
2437 out->st_dev = in->st_dev; in freebsd11_cvtstat32()
2438 if (out->st_dev != in->st_dev) { in freebsd11_cvtstat32()
2449 out->st_rdev = in->st_rdev; in freebsd11_cvtstat32()
2450 if (out->st_rdev != in->st_rdev) { in freebsd11_cvtstat32()
2467 out->st_lspare = 0; in freebsd11_cvtstat32()
2468 bzero((char *)&out->st_birthtim + sizeof(out->st_birthtim), in freebsd11_cvtstat32()
2469 sizeof(*out) - offsetof(struct freebsd11_stat32, in freebsd11_cvtstat32()
2470 st_birthtim) - sizeof(out->st_birthtim)); in freebsd11_cvtstat32()
2482 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb); in freebsd11_freebsd32_stat()
2487 error = copyout(&sb32, uap->ub, sizeof (sb32)); in freebsd11_freebsd32_stat()
2499 error = kern_fstat(td, uap->fd, &sb); in freebsd11_freebsd32_fstat()
2504 error = copyout(&sb32, uap->sb, sizeof (sb32)); in freebsd11_freebsd32_fstat()
2516 error = kern_statat(td, uap->flag, uap->fd, uap->path, UIO_USERSPACE, in freebsd11_freebsd32_fstatat()
2522 error = copyout(&sb32, uap->buf, sizeof (sb32)); in freebsd11_freebsd32_fstatat()
2534 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path, in freebsd11_freebsd32_lstat()
2540 error = copyout(&sb32, uap->ub, sizeof (sb32)); in freebsd11_freebsd32_lstat()
2553 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); in freebsd11_freebsd32_fhstat()
2561 error = copyout(&sb32, uap->sb, sizeof (sb32)); in freebsd11_freebsd32_fhstat()
2607 error = kern_statat(td, 0, AT_FDCWD, uap->path, UIO_USERSPACE, &sb); in freebsd11_freebsd32_nstat()
2612 error = copyout(&nsb, uap->ub, sizeof (nsb)); in freebsd11_freebsd32_nstat()
2624 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, uap->path, in freebsd11_freebsd32_nlstat()
2630 error = copyout(&nsb, uap->ub, sizeof (nsb)); in freebsd11_freebsd32_nlstat()
2642 error = kern_fstat(td, uap->fd, &ub); in freebsd11_freebsd32_nfstat()
2647 error = copyout(&nub, uap->sb, sizeof(nub)); in freebsd11_freebsd32_nfstat()
2659 if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) in freebsd32___sysctl()
2661 error = copyin(uap->name, name, uap->namelen * sizeof(int)); in freebsd32___sysctl()
2664 if (uap->oldlenp) { in freebsd32___sysctl()
2665 error = fueword32(uap->oldlenp, &tmp); in freebsd32___sysctl()
2672 error = userland_sysctl(td, name, uap->namelen, in freebsd32___sysctl()
2673 uap->old, &oldlen, 1, in freebsd32___sysctl()
2674 uap->new, uap->newlen, &j, SCTL_MASK32); in freebsd32___sysctl()
2677 if (uap->oldlenp != NULL && suword32(uap->oldlenp, j) != 0) in freebsd32___sysctl()
2690 if (uap->oldlenp != NULL) { in freebsd32___sysctlbyname()
2691 error = fueword32(uap->oldlenp, &tmp); in freebsd32___sysctlbyname()
2698 error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old, in freebsd32___sysctlbyname()
2699 &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1); in freebsd32___sysctlbyname()
2702 if (uap->oldlenp != NULL && suword32(uap->oldlenp, rv) != 0) in freebsd32___sysctlbyname()
2714 error = copyin(uap->jail, &version, sizeof(uint32_t)); in freebsd32_jail()
2725 error = copyin(uap->jail, &j32_v0, sizeof(struct jail32_v0)); in freebsd32_jail()
2737 * Version 1 was used by multi-IPv4 jail implementations in freebsd32_jail()
2744 /* FreeBSD multi-IPv4/IPv6,noIP jails. */ in freebsd32_jail()
2747 error = copyin(uap->jail, &j32, sizeof(struct jail32)); in freebsd32_jail()
2762 /* Sci-Fi jails are not supported, sorry. */ in freebsd32_jail()
2775 if (uap->iovcnt & 1) in freebsd32_jail_set()
2778 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_jail_set()
2781 error = kern_jail_set(td, auio, uap->flags); in freebsd32_jail_set()
2794 if (uap->iovcnt & 1) in freebsd32_jail_get()
2797 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_jail_get()
2800 error = kern_jail_get(td, auio, uap->flags); in freebsd32_jail_get()
2802 for (i = 0; i < uap->iovcnt; i++) { in freebsd32_jail_get()
2803 PTROUT_CP(auio->uio_iov[i], iov32, iov_base); in freebsd32_jail_get()
2804 CP(auio->uio_iov[i], iov32, iov_len); in freebsd32_jail_get()
2805 error = copyout(&iov32, uap->iovp + i, sizeof(iov32)); in freebsd32_jail_get()
2820 if (uap->act) { in freebsd32_sigaction()
2821 error = copyin(uap->act, &s32, sizeof(s32)); in freebsd32_sigaction()
2830 error = kern_sigaction(td, uap->sig, sap, &osa, 0); in freebsd32_sigaction()
2831 if (error == 0 && uap->oact != NULL) { in freebsd32_sigaction()
2835 error = copyout(&s32, uap->oact, sizeof(s32)); in freebsd32_sigaction()
2849 if (uap->act) { in freebsd4_freebsd32_sigaction()
2850 error = copyin(uap->act, &s32, sizeof(s32)); in freebsd4_freebsd32_sigaction()
2859 error = kern_sigaction(td, uap->sig, sap, &osa, KSA_FREEBSD4); in freebsd4_freebsd32_sigaction()
2860 if (error == 0 && uap->oact != NULL) { in freebsd4_freebsd32_sigaction()
2864 error = copyout(&s32, uap->oact, sizeof(s32)); in freebsd4_freebsd32_sigaction()
2887 if (uap->signum <= 0 || uap->signum >= ONSIG) in ofreebsd32_sigaction()
2890 if (uap->nsa) { in ofreebsd32_sigaction()
2891 error = copyin(uap->nsa, &s32, sizeof(s32)); in ofreebsd32_sigaction()
2900 error = kern_sigaction(td, uap->signum, sap, &osa, KSA_OSIGSET); in ofreebsd32_sigaction()
2901 if (error == 0 && uap->osa != NULL) { in ofreebsd32_sigaction()
2905 error = copyout(&s32, uap->osa, sizeof(s32)); in ofreebsd32_sigaction()
2924 if (uap->signum <= 0 || uap->signum >= ONSIG) in ofreebsd32_sigvec()
2927 if (uap->nsv) { in ofreebsd32_sigvec()
2928 error = copyin(uap->nsv, &vec, sizeof(vec)); in ofreebsd32_sigvec()
2938 error = kern_sigaction(td, uap->signum, sap, &osa, KSA_OSIGSET); in ofreebsd32_sigvec()
2939 if (error == 0 && uap->osv != NULL) { in ofreebsd32_sigvec()
2945 error = copyout(&vec, uap->osv, sizeof(vec)); in ofreebsd32_sigvec()
2963 if (uap->nss != NULL) { in ofreebsd32_sigstack()
2964 error = copyin(uap->nss, &s32, sizeof(s32)); in ofreebsd32_sigstack()
2973 oss.ss_sp = td->td_sigstk.ss_sp; in ofreebsd32_sigstack()
2976 td->td_sigstk.ss_sp = nss.ss_sp; in ofreebsd32_sigstack()
2977 td->td_sigstk.ss_size = 0; in ofreebsd32_sigstack()
2978 td->td_sigstk.ss_flags |= (nss.ss_onstack & SS_ONSTACK); in ofreebsd32_sigstack()
2979 td->td_pflags |= TDP_ALTSTACK; in ofreebsd32_sigstack()
2981 if (uap->oss != NULL) { in ofreebsd32_sigstack()
2984 error = copyout(&s32, uap->oss, sizeof(s32)); in ofreebsd32_sigstack()
2995 TIMER_RELTIME, uap->rqtp, uap->rmtp)); in freebsd32_nanosleep()
3004 error = freebsd32_user_clock_nanosleep(td, uap->clock_id, uap->flags, in freebsd32_clock_nanosleep()
3005 uap->rqtp, uap->rmtp); in freebsd32_clock_nanosleep()
3040 struct timespec ats; in freebsd32_clock_gettime() local
3044 error = kern_clock_gettime(td, uap->clock_id, &ats); in freebsd32_clock_gettime()
3046 CP(ats, ats32, tv_sec); in freebsd32_clock_gettime()
3047 CP(ats, ats32, tv_nsec); in freebsd32_clock_gettime()
3048 error = copyout(&ats32, uap->tp, sizeof(ats32)); in freebsd32_clock_gettime()
3057 struct timespec ats; in freebsd32_clock_settime() local
3061 error = copyin(uap->tp, &ats32, sizeof(ats32)); in freebsd32_clock_settime()
3064 CP(ats32, ats, tv_sec); in freebsd32_clock_settime()
3065 CP(ats32, ats, tv_nsec); in freebsd32_clock_settime()
3067 return (kern_clock_settime(td, uap->clock_id, &ats)); in freebsd32_clock_settime()
3078 if (uap->tp == NULL) in freebsd32_clock_getres()
3080 error = kern_clock_getres(td, uap->clock_id, &ts); in freebsd32_clock_getres()
3084 error = copyout(&ts32, uap->tp, sizeof(ts32)); in freebsd32_clock_getres()
3096 if (uap->evp == NULL) { in freebsd32_ktimer_create()
3100 error = copyin(uap->evp, &ev32, sizeof(ev32)); in freebsd32_ktimer_create()
3107 error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); in freebsd32_ktimer_create()
3109 error = copyout(&id, uap->timerid, sizeof(int)); in freebsd32_ktimer_create()
3124 error = copyin(uap->value, &val32, sizeof(val32)); in freebsd32_ktimer_settime()
3128 ovalp = uap->ovalue != NULL ? &oval : NULL; in freebsd32_ktimer_settime()
3129 error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); in freebsd32_ktimer_settime()
3130 if (error == 0 && uap->ovalue != NULL) { in freebsd32_ktimer_settime()
3132 error = copyout(&oval32, uap->ovalue, sizeof(oval32)); in freebsd32_ktimer_settime()
3145 error = kern_ktimer_gettime(td, uap->timerid, &val); in freebsd32_ktimer_gettime()
3148 error = copyout(&val32, uap->value, sizeof(val32)); in freebsd32_ktimer_gettime()
3161 error = kern_timerfd_gettime(td, uap->fd, &curr_value); in freebsd32_timerfd_gettime()
3167 error = copyout(&curr_value32, uap->curr_value, in freebsd32_timerfd_gettime()
3182 error = copyin(uap->new_value, &new_value32, sizeof(new_value32)); in freebsd32_timerfd_settime()
3189 if (uap->old_value == NULL) { in freebsd32_timerfd_settime()
3190 error = kern_timerfd_settime(td, uap->fd, uap->flags, in freebsd32_timerfd_settime()
3193 error = kern_timerfd_settime(td, uap->fd, uap->flags, in freebsd32_timerfd_settime()
3200 error = copyout(&old_value32, uap->old_value, in freebsd32_timerfd_settime()
3214 error = kern_clock_getcpuclockid2(td, PAIR32TO64(id_t, uap->id), in freebsd32_clock_getcpuclockid2()
3215 uap->which, &clk_id); in freebsd32_clock_getcpuclockid2()
3217 error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t)); in freebsd32_clock_getcpuclockid2()
3229 if (uap->param_size < 0 || in freebsd32_thr_new()
3230 uap->param_size > sizeof(struct thr_param32)) in freebsd32_thr_new()
3234 error = copyin(uap->param, &param32, uap->param_size); in freebsd32_thr_new()
3263 if (uap->timeout != NULL) { in freebsd32_thr_suspend()
3264 error = copyin((const void *)uap->timeout, (void *)&ts32, in freebsd32_thr_suspend()
3279 dst->si_signo = src->si_signo; in siginfo_to_siginfo32()
3280 dst->si_errno = src->si_errno; in siginfo_to_siginfo32()
3281 dst->si_code = src->si_code; in siginfo_to_siginfo32()
3282 dst->si_pid = src->si_pid; in siginfo_to_siginfo32()
3283 dst->si_uid = src->si_uid; in siginfo_to_siginfo32()
3284 dst->si_status = src->si_status; in siginfo_to_siginfo32()
3285 dst->si_addr = (uintptr_t)src->si_addr; in siginfo_to_siginfo32()
3286 dst->si_value.sival_int = src->si_value.sival_int; in siginfo_to_siginfo32()
3287 dst->si_timerid = src->si_timerid; in siginfo_to_siginfo32()
3288 dst->si_overrun = src->si_overrun; in siginfo_to_siginfo32()
3304 * On 32-bit ABIs, sival_int and sival_ptr are the same. in freebsd32_sigqueue()
3305 * On 64-bit little-endian ABIs, the low bits are the same. in freebsd32_sigqueue()
3306 * In 64-bit big-endian ABIs, sival_int overlaps with in freebsd32_sigqueue()
3312 sv.sival_int = (uint32_t)(uint64_t)uap->value; in freebsd32_sigqueue()
3314 return (kern_sigqueue(td, uap->pid, uap->signum, &sv)); in freebsd32_sigqueue()
3328 if (uap->timeout) { in freebsd32_sigtimedwait()
3329 error = copyin(uap->timeout, &ts32, sizeof(ts32)); in freebsd32_sigtimedwait()
3338 error = copyin(uap->set, &set, sizeof(set)); in freebsd32_sigtimedwait()
3346 if (uap->info) { in freebsd32_sigtimedwait()
3348 error = copyout(&si32, uap->info, sizeof(struct __siginfo32)); in freebsd32_sigtimedwait()
3352 td->td_retval[0] = ksi.ksi_signo; in freebsd32_sigtimedwait()
3367 error = copyin(uap->set, &set, sizeof(set)); in freebsd32_sigwaitinfo()
3375 if (uap->info) { in freebsd32_sigwaitinfo()
3377 error = copyout(&si32, uap->info, sizeof(struct __siginfo32)); in freebsd32_sigwaitinfo()
3380 td->td_retval[0] = ksi.ksi_signo; in freebsd32_sigwaitinfo()
3389 return (kern_cpuset_setid(td, uap->which, in freebsd32_cpuset_setid()
3390 PAIR32TO64(id_t, uap->id), uap->setid)); in freebsd32_cpuset_setid()
3398 return (kern_cpuset_getid(td, uap->level, uap->which, in freebsd32_cpuset_getid()
3399 PAIR32TO64(id_t, uap->id), uap->setid)); in freebsd32_cpuset_getid()
3414 p = (int *)kb->__bits; in copyin32_set()
3435 const int *kp = (const int *)kb->__bits; in copyout32_set()
3436 int *up = (int *)ub->__bits; in copyout32_set()
3465 return (user_cpuset_getaffinity(td, uap->level, uap->which, in freebsd32_cpuset_getaffinity()
3466 PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask, in freebsd32_cpuset_getaffinity()
3475 return (user_cpuset_setaffinity(td, uap->level, uap->which, in freebsd32_cpuset_setaffinity()
3476 PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask, in freebsd32_cpuset_setaffinity()
3485 return (kern_cpuset_getdomain(td, uap->level, uap->which, in freebsd32_cpuset_getdomain()
3486 PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy, in freebsd32_cpuset_getdomain()
3495 return (kern_cpuset_setdomain(td, uap->level, uap->which, in freebsd32_cpuset_setdomain()
3496 PAIR32TO64(id_t,uap->id), uap->domainsetsize, uap->mask, uap->policy, in freebsd32_cpuset_setdomain()
3513 * Mount flags are now 64-bits. On 32-bit archtectures only in freebsd32_nmount()
3514 * 32-bits are passed in, but from here on everything handles in freebsd32_nmount()
3515 * 64-bit flags correctly. in freebsd32_nmount()
3517 flags = uap->flags; in freebsd32_nmount()
3534 if ((uap->iovcnt & 1) || (uap->iovcnt < 4)) in freebsd32_nmount()
3537 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); in freebsd32_nmount()
3555 if (uap->zzz) {
3556 error = copyin(uap->zzz, &s32, sizeof(s32));
3565 if (uap->zzz) {
3608 sysent = imgp->sysent; in freebsd32_copyout_strings()
3610 arginfo = (struct freebsd32_ps_strings *)PROC_PS_STRINGS(imgp->proc); in freebsd32_copyout_strings()
3611 imgp->ps_strings = arginfo; in freebsd32_copyout_strings()
3617 if (!PROC_HAS_SHP(imgp->proc)) { in freebsd32_copyout_strings()
3618 szsigcode = *sysent->sv_szsigcode; in freebsd32_copyout_strings()
3619 destp -= szsigcode; in freebsd32_copyout_strings()
3621 error = copyout(sysent->sv_sigcode, (void *)destp, in freebsd32_copyout_strings()
3630 if (imgp->execpath != NULL && imgp->auxargs != NULL) { in freebsd32_copyout_strings()
3631 execpath_len = strlen(imgp->execpath) + 1; in freebsd32_copyout_strings()
3632 destp -= execpath_len; in freebsd32_copyout_strings()
3633 imgp->execpathp = (void *)destp; in freebsd32_copyout_strings()
3634 error = copyout(imgp->execpath, imgp->execpathp, execpath_len); in freebsd32_copyout_strings()
3643 destp -= sizeof(canary); in freebsd32_copyout_strings()
3644 imgp->canary = (void *)destp; in freebsd32_copyout_strings()
3645 error = copyout(canary, imgp->canary, sizeof(canary)); in freebsd32_copyout_strings()
3648 imgp->canarylen = sizeof(canary); in freebsd32_copyout_strings()
3655 destp -= sizeof(pagesizes32); in freebsd32_copyout_strings()
3657 imgp->pagesizes = (void *)destp; in freebsd32_copyout_strings()
3658 error = copyout(pagesizes32, imgp->pagesizes, sizeof(pagesizes32)); in freebsd32_copyout_strings()
3661 imgp->pagesizeslen = sizeof(pagesizes32); in freebsd32_copyout_strings()
3666 destp -= ARG_MAX - imgp->args->stringspace; in freebsd32_copyout_strings()
3670 if (imgp->auxargs) { in freebsd32_copyout_strings()
3675 destp -= AT_COUNT * sizeof(Elf32_Auxinfo); in freebsd32_copyout_strings()
3685 vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; in freebsd32_copyout_strings()
3692 stringp = imgp->args->begin_argv; in freebsd32_copyout_strings()
3693 argc = imgp->args->argc; in freebsd32_copyout_strings()
3694 envc = imgp->args->envc; in freebsd32_copyout_strings()
3696 * Copy out strings - arguments and environment. in freebsd32_copyout_strings()
3699 ARG_MAX - imgp->args->stringspace); in freebsd32_copyout_strings()
3706 imgp->argv = vectp; in freebsd32_copyout_strings()
3707 if (suword32(&arginfo->ps_argvstr, (uint32_t)(intptr_t)vectp) != 0 || in freebsd32_copyout_strings()
3708 suword32(&arginfo->ps_nargvstr, argc) != 0) in freebsd32_copyout_strings()
3714 for (; argc > 0; --argc) { in freebsd32_copyout_strings()
3726 imgp->envv = vectp; in freebsd32_copyout_strings()
3727 if (suword32(&arginfo->ps_envstr, (uint32_t)(intptr_t)vectp) != 0 || in freebsd32_copyout_strings()
3728 suword32(&arginfo->ps_nenvstr, envc) != 0) in freebsd32_copyout_strings()
3734 for (; envc > 0; --envc) { in freebsd32_copyout_strings()
3746 if (imgp->auxargs) { in freebsd32_copyout_strings()
3748 error = imgp->sysent->sv_copyout_auxargs(imgp, in freebsd32_copyout_strings()
3764 if ((error = copyin(&uap->stat->version, &version, sizeof(version))) in freebsd32_kldstat()
3773 error = kern_kldstat(td, uap->fileid, stat); in freebsd32_kldstat()
3775 bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name)); in freebsd32_kldstat()
3780 bcopy(&stat->pathname[0], &stat32->pathname[0], in freebsd32_kldstat()
3781 sizeof(stat->pathname)); in freebsd32_kldstat()
3782 stat32->version = version; in freebsd32_kldstat()
3783 error = copyout(stat32, uap->stat, version); in freebsd32_kldstat()
3796 error = kern_posix_fallocate(td, uap->fd, in freebsd32_posix_fallocate()
3797 PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); in freebsd32_posix_fallocate()
3807 error = kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), in freebsd32_posix_fadvise()
3808 PAIR32TO64(off_t, uap->len), uap->advice); in freebsd32_posix_fadvise()
3817 switch (sig->sigev_notify) { in convert_sigevent32()
3852 if (uap->com >= PROC_PROCCTL_MD_MIN) in freebsd32_procctl()
3853 return (cpu_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), in freebsd32_procctl()
3854 uap->com, PTRIN(uap->data))); in freebsd32_procctl()
3856 switch (uap->com) { in freebsd32_procctl()
3866 error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); in freebsd32_procctl()
3873 if (uap->data != NULL) in freebsd32_procctl()
3881 error = copyin(uap->data, &x32.rp, sizeof(x32.rp)); in freebsd32_procctl()
3889 error = copyin(uap->data, &x.rk, sizeof(x.rk)); in freebsd32_procctl()
3905 error = copyin(uap->data, &signum, sizeof(signum)); in freebsd32_procctl()
3916 error = kern_procctl(td, uap->idtype, PAIR32TO64(id_t, uap->id), in freebsd32_procctl()
3917 uap->com, data); in freebsd32_procctl()
3918 switch (uap->com) { in freebsd32_procctl()
3921 error = copyout(&x.rs, uap->data, sizeof(x.rs)); in freebsd32_procctl()
3924 error1 = copyout(&x.rk, uap->data, sizeof(x.rk)); in freebsd32_procctl()
3937 error = copyout(&flags, uap->data, sizeof(flags)); in freebsd32_procctl()
3941 error = copyout(&signum, uap->data, sizeof(signum)); in freebsd32_procctl()
3952 switch (uap->cmd) { in freebsd32_fcntl()
3967 tmp = (unsigned int)(uap->arg); in freebsd32_fcntl()
3970 tmp = uap->arg; in freebsd32_fcntl()
3973 return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); in freebsd32_fcntl()
3984 if (uap->ts != NULL) { in freebsd32_ppoll()
3985 error = copyin(uap->ts, &ts32, sizeof(ts32)); in freebsd32_ppoll()
3993 if (uap->set != NULL) { in freebsd32_ppoll()
3994 error = copyin(uap->set, &set, sizeof(set)); in freebsd32_ppoll()
4001 return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); in freebsd32_ppoll()
4012 error = kern_sched_rr_get_interval(td, uap->pid, &ts); in freebsd32_sched_rr_get_interval()
4016 error = copyout(&ts32, uap->interval, sizeof(ts32)); in freebsd32_sched_rr_get_interval()
4072 error = copyin(uap->tp, &tx32, sizeof(tx32)); in freebsd32_ntp_adjtime()
4078 error = copyout(&tx32, uap->tp, sizeof(tx32)); in freebsd32_ntp_adjtime()
4080 td->td_retval[0] = retval; in freebsd32_ntp_adjtime()
4103 if ((error = copyin(uap->cest, &cest32, in freebsd32_ffclock_setestimate()
4148 error = copyout(&cest32, uap->cest, sizeof(struct ffclock_estimate32)); in freebsd32_ffclock_getestimate()
4174 hostid = uap->hostid; in ofreebsd32_sethostid()
4184 return (user_setcred(td, uap->flags, uap->wcred, uap->size, true)); in freebsd32_setcred()