Lines Matching refs:args

136 linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)  in linux_sysinfo()  argument
180 return (copyout(&sysinfo, args->info, sizeof(sysinfo))); in linux_sysinfo()
185 linux_alarm(struct thread *td, struct linux_alarm_args *args) in linux_alarm() argument
191 secs = args->secs; in linux_alarm()
217 linux_brk(struct thread *td, struct linux_brk_args *args) in linux_brk() argument
223 new = (uintptr_t)args->dsend; in linux_brk()
236 linux_uselib(struct thread *td, struct linux_uselib_args *args) in linux_uselib() argument
260 UIO_USERSPACE, args->library, td); in linux_uselib()
263 LCONVPATHEXIST(td, args->library, &library); in linux_uselib()
489 linux_select(struct thread *td, struct linux_select_args *args) in linux_select() argument
499 if (args->timeout) { in linux_select()
500 if ((error = copyin(args->timeout, &ltv, sizeof(ltv)))) in linux_select()
524 error = kern_select(td, args->nfds, args->readfds, args->writefds, in linux_select()
525 args->exceptfds, tvp, LINUX_NFDBITS); in linux_select()
529 if (args->timeout) { in linux_select()
546 if ((error = copyout(&ltv, args->timeout, sizeof(ltv)))) in linux_select()
556 linux_mremap(struct thread *td, struct linux_mremap_args *args) in linux_mremap() argument
562 if (args->flags & ~(LINUX_MREMAP_FIXED | LINUX_MREMAP_MAYMOVE)) { in linux_mremap()
571 if (args->addr & PAGE_MASK) { in linux_mremap()
576 args->new_len = round_page(args->new_len); in linux_mremap()
577 args->old_len = round_page(args->old_len); in linux_mremap()
579 if (args->new_len > args->old_len) { in linux_mremap()
584 if (args->new_len < args->old_len) { in linux_mremap()
585 addr = args->addr + args->new_len; in linux_mremap()
586 len = args->old_len - args->new_len; in linux_mremap()
590 td->td_retval[0] = error ? 0 : (uintptr_t)args->addr; in linux_mremap()
599 linux_msync(struct thread *td, struct linux_msync_args *args) in linux_msync() argument
602 return (kern_msync(td, args->addr, args->len, in linux_msync()
603 args->fl & ~LINUX_MS_SYNC)); in linux_msync()
608 linux_time(struct thread *td, struct linux_time_args *args) in linux_time() argument
616 if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm)))) in linux_time()
644 linux_times(struct thread *td, struct linux_times_args *args) in linux_times() argument
651 if (args->buf != NULL) { in linux_times()
666 if ((error = copyout(&tms, args->buf, sizeof(tms)))) in linux_times()
676 linux_newuname(struct thread *td, struct linux_newuname_args *args) in linux_newuname() argument
709 return (copyout(&utsname, args->buf, sizeof(utsname))); in linux_newuname()
719 linux_utime(struct thread *td, struct linux_utime_args *args) in linux_utime() argument
729 LCONVPATHEXIST(td, args->fname, &fname); in linux_utime()
731 if (args->times) { in linux_utime()
732 if ((error = copyin(args->times, &lut, sizeof lut))) { in linux_utime()
746 error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, in linux_utime()
759 linux_utimes(struct thread *td, struct linux_utimes_args *args) in linux_utimes() argument
769 LCONVPATHEXIST(td, args->fname, &fname); in linux_utimes()
771 if (args->tptr != NULL) { in linux_utimes()
772 if ((error = copyin(args->tptr, ltv, sizeof ltv))) { in linux_utimes()
784 error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, in linux_utimes()
807 linux_utimensat(struct thread *td, struct linux_utimensat_args *args) in linux_utimensat() argument
814 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; in linux_utimensat()
816 if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW) in linux_utimensat()
819 if (args->times != NULL) { in linux_utimensat()
820 error = copyin(args->times, l_times, sizeof(l_times)); in linux_utimensat()
865 if (args->pathname != NULL) { in linux_utimensat()
866 return (kern_utimensat(td, dfd, args->pathname, in linux_utimensat()
871 if (args->pathname != NULL) in linux_utimensat()
872 LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); in linux_utimensat()
873 else if (args->flags != 0) in linux_utimensat()
876 if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) in linux_utimensat()
892 linux_futimesat(struct thread *td, struct linux_futimesat_args *args) in linux_futimesat() argument
901 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; in linux_futimesat()
903 LCONVPATHEXIST_AT(td, args->filename, &fname, dfd); in linux_futimesat()
905 if (args->utimes != NULL) { in linux_futimesat()
906 if ((error = copyin(args->utimes, ltv, sizeof ltv))) { in linux_futimesat()
919 error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE, in linux_futimesat()
983 linux_waitpid(struct thread *td, struct linux_waitpid_args *args) in linux_waitpid() argument
987 wait4_args.pid = args->pid; in linux_waitpid()
988 wait4_args.status = args->status; in linux_waitpid()
989 wait4_args.options = args->options; in linux_waitpid()
997 linux_wait4(struct thread *td, struct linux_wait4_args *args) in linux_wait4() argument
1002 if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | in linux_wait4()
1007 linux_to_bsd_waitopts(args->options, &options); in linux_wait4()
1009 if (args->rusage != NULL) in linux_wait4()
1013 error = linux_common_wait(td, args->pid, args->status, options, wrup); in linux_wait4()
1016 if (args->rusage != NULL) in linux_wait4()
1017 error = linux_copyout_rusage(&wru.wru_self, args->rusage); in linux_wait4()
1022 linux_waitid(struct thread *td, struct linux_waitid_args *args) in linux_waitid() argument
1033 linux_to_bsd_waitopts(args->options, &options); in linux_waitid()
1040 switch (args->idtype) { in linux_waitid()
1045 if (args->id <= 0) in linux_waitid()
1050 if (args->id <= 0) in linux_waitid()
1058 error = kern_wait6(td, idtype, args->id, &status, options, in linux_waitid()
1062 if (args->rusage != NULL) { in linux_waitid()
1064 args->rusage); in linux_waitid()
1068 if (args->info != NULL) { in linux_waitid()
1075 error = copyout(&lsi, args->info, sizeof(lsi)); in linux_waitid()
1084 linux_mknod(struct thread *td, struct linux_mknod_args *args) in linux_mknod() argument
1093 path = args->path; in linux_mknod()
1096 LCONVPATHCREAT(td, args->path, &path); in linux_mknod()
1100 switch (args->mode & S_IFMT) { in linux_mknod()
1104 args->mode); in linux_mknod()
1110 args->mode, args->dev); in linux_mknod()
1118 args->mode |= S_IFREG; in linux_mknod()
1122 O_WRONLY | O_CREAT | O_TRUNC, args->mode); in linux_mknod()
1138 linux_mknodat(struct thread *td, struct linux_mknodat_args *args) in linux_mknodat() argument
1145 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; in linux_mknodat()
1149 path = __DECONST(char *, args->filename); in linux_mknodat()
1152 LCONVPATHCREAT_AT(td, args->filename, &path, dfd); in linux_mknodat()
1156 switch (args->mode & S_IFMT) { in linux_mknodat()
1159 error = kern_mkfifoat(td, dfd, path, seg, args->mode); in linux_mknodat()
1164 error = kern_mknodat(td, dfd, path, seg, args->mode, in linux_mknodat()
1165 args->dev); in linux_mknodat()
1173 args->mode |= S_IFREG; in linux_mknodat()
1177 O_WRONLY | O_CREAT | O_TRUNC, args->mode); in linux_mknodat()
1195 linux_personality(struct thread *td, struct linux_personality_args *args) in linux_personality() argument
1204 if (args->per != 0xffffffff) in linux_personality()
1205 pem->persona = args->per; in linux_personality()
1263 linux_nice(struct thread *td, struct linux_nice_args *args) in linux_nice() argument
1266 return (kern_setpriority(td, PRIO_PROCESS, 0, args->inc)); in linux_nice()
1271 linux_setgroups(struct thread *td, struct linux_setgroups_args *args) in linux_setgroups() argument
1279 ngrp = args->gidsetsize; in linux_setgroups()
1283 error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); in linux_setgroups()
1328 linux_getgroups(struct thread *td, struct linux_getgroups_args *args) in linux_getgroups() argument
1345 if ((ngrp = args->gidsetsize) == 0) { in linux_getgroups()
1361 error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t)); in linux_getgroups()
1396 linux_setrlimit(struct thread *td, struct linux_setrlimit_args *args) in linux_setrlimit() argument
1403 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_setrlimit()
1406 which = linux_to_bsd_resource[args->resource]; in linux_setrlimit()
1410 error = copyin(args->rlim, &rlim, sizeof(rlim)); in linux_setrlimit()
1421 linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args) in linux_old_getrlimit() argument
1427 if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { in linux_old_getrlimit()
1430 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_old_getrlimit()
1433 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_old_getrlimit()
1436 which = linux_to_bsd_resource[args->resource]; in linux_old_getrlimit()
1457 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_old_getrlimit()
1462 linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args) in linux_getrlimit() argument
1468 if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { in linux_getrlimit()
1471 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_getrlimit()
1474 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_getrlimit()
1477 which = linux_to_bsd_resource[args->resource]; in linux_getrlimit()
1485 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_getrlimit()
1490 struct linux_sched_setscheduler_args *args) in linux_sched_setscheduler() argument
1496 switch (args->policy) { in linux_sched_setscheduler()
1510 error = copyin(args->param, &sched_param, sizeof(sched_param)); in linux_sched_setscheduler()
1541 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_setscheduler()
1552 struct linux_sched_getscheduler_args *args) in linux_sched_getscheduler() argument
1557 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_getscheduler()
1580 struct linux_sched_get_priority_max_args *args) in linux_sched_get_priority_max() argument
1585 switch (args->policy) { in linux_sched_get_priority_max()
1598 switch (args->policy) { in linux_sched_get_priority_max()
1616 struct linux_sched_get_priority_min_args *args) in linux_sched_get_priority_min() argument
1621 switch (args->policy) { in linux_sched_get_priority_min()
1634 switch (args->policy) { in linux_sched_get_priority_min()
1662 linux_reboot(struct thread *td, struct linux_reboot_args *args) in linux_reboot() argument
1666 if (args->magic1 != REBOOT_MAGIC1) in linux_reboot()
1669 switch (args->magic2) { in linux_reboot()
1678 switch (args->cmd) { in linux_reboot()
1699 linux_getpid(struct thread *td, struct linux_getpid_args *args) in linux_getpid() argument
1708 linux_gettid(struct thread *td, struct linux_gettid_args *args) in linux_gettid() argument
1721 linux_getppid(struct thread *td, struct linux_getppid_args *args) in linux_getppid() argument
1729 linux_getgid(struct thread *td, struct linux_getgid_args *args) in linux_getgid() argument
1737 linux_getuid(struct thread *td, struct linux_getuid_args *args) in linux_getuid() argument
1745 linux_getsid(struct thread *td, struct linux_getsid_args *args) in linux_getsid() argument
1748 return (kern_getsid(td, args->pid)); in linux_getsid()
1759 linux_getpriority(struct thread *td, struct linux_getpriority_args *args) in linux_getpriority() argument
1763 error = kern_getpriority(td, args->which, args->who); in linux_getpriority()
1769 linux_sethostname(struct thread *td, struct linux_sethostname_args *args) in linux_sethostname() argument
1775 return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname, in linux_sethostname()
1776 args->len, 0, 0)); in linux_sethostname()
1780 linux_setdomainname(struct thread *td, struct linux_setdomainname_args *args) in linux_setdomainname() argument
1786 return (userland_sysctl(td, name, 2, 0, 0, 0, args->name, in linux_setdomainname()
1787 args->len, 0, 0)); in linux_setdomainname()
1791 linux_exit_group(struct thread *td, struct linux_exit_group_args *args) in linux_exit_group() argument
1795 args->error_code); in linux_exit_group()
1802 exit1(td, args->error_code, 0); in linux_exit_group()
1922 linux_prctl(struct thread *td, struct linux_prctl_args *args) in linux_prctl() argument
1929 switch (args->option) { in linux_prctl()
1931 if (!LINUX_SIG_VALID(args->arg2)) in linux_prctl()
1933 pdeath_signal = linux_to_bsd_signal(args->arg2); in linux_prctl()
1943 (void *)(register_t)args->arg2, in linux_prctl()
1973 switch (args->arg2) { in linux_prctl()
2008 error = copyinstr((void *)(register_t)args->arg2, comm, in linux_prctl()
2019 error = copyin((void *)(register_t)args->arg2, comm, in linux_prctl()
2034 error = copyout(comm, (void *)(register_t)args->arg2, in linux_prctl()
2050 (int)args->arg2); in linux_prctl()
2055 arg = args->arg2 == 1 ? in linux_prctl()
2065 linux_msg(td, "unsupported prctl option %d", args->option); in linux_prctl()
2180 struct linux_sched_getaffinity_args *args) in linux_sched_getaffinity() argument
2185 if (args->len < sizeof(cpuset_t)) in linux_sched_getaffinity()
2188 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_getaffinity()
2195 tdt->td_tid, sizeof(cpuset_t), (cpuset_t *)args->user_mask_ptr); in linux_sched_getaffinity()
2207 struct linux_sched_setaffinity_args *args) in linux_sched_setaffinity() argument
2211 if (args->len < sizeof(cpuset_t)) in linux_sched_setaffinity()
2214 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_setaffinity()
2221 tdt->td_tid, sizeof(cpuset_t), (cpuset_t *) args->user_mask_ptr)); in linux_sched_setaffinity()
2230 linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) in linux_prlimit64() argument
2239 if (args->new == NULL && args->old != NULL) { in linux_prlimit64()
2240 if (linux_get_dummy_limit(args->resource, &rlim)) { in linux_prlimit64()
2243 return (copyout(&lrlim, args->old, sizeof(lrlim))); in linux_prlimit64()
2247 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_prlimit64()
2250 which = linux_to_bsd_resource[args->resource]; in linux_prlimit64()
2254 if (args->new != NULL) { in linux_prlimit64()
2260 error = copyin(args->new, &nrlim, sizeof(nrlim)); in linux_prlimit64()
2266 if (args->new != NULL) in linux_prlimit64()
2270 if (args->pid == 0) { in linux_prlimit64()
2274 error = pget(args->pid, flags, &p); in linux_prlimit64()
2278 if (args->old != NULL) { in linux_prlimit64()
2290 error = copyout(&lrlim, args->old, sizeof(lrlim)); in linux_prlimit64()
2295 if (args->new != NULL) in linux_prlimit64()
2304 linux_pselect6(struct thread *td, struct linux_pselect6_args *args) in linux_pselect6() argument
2316 if (args->sig != NULL) { in linux_pselect6()
2317 error = copyin(args->sig, &lpse6, sizeof(lpse6)); in linux_pselect6()
2336 if (args->tsp != NULL) { in linux_pselect6()
2337 error = copyin(args->tsp, &lts, sizeof(lts)); in linux_pselect6()
2353 error = kern_pselect(td, args->nfds, args->readfds, args->writefds, in linux_pselect6()
2354 args->exceptfds, tvp, ssp, LINUX_NFDBITS); in linux_pselect6()
2356 if (error == 0 && args->tsp != NULL) { in linux_pselect6()
2377 error = copyout(&lts, args->tsp, sizeof(lts)); in linux_pselect6()
2384 linux_ppoll(struct thread *td, struct linux_ppoll_args *args) in linux_ppoll() argument
2394 if (args->sset != NULL) { in linux_ppoll()
2395 if (args->ssize != sizeof(l_ss)) in linux_ppoll()
2397 error = copyin(args->sset, &l_ss, sizeof(l_ss)); in linux_ppoll()
2404 if (args->tsp != NULL) { in linux_ppoll()
2405 error = copyin(args->tsp, &lts, sizeof(lts)); in linux_ppoll()
2417 error = kern_poll(td, args->fds, args->nfds, tsp, ssp); in linux_ppoll()
2419 if (error == 0 && args->tsp != NULL) { in linux_ppoll()
2431 error = copyout(&lts, args->tsp, sizeof(lts)); in linux_ppoll()
2531 linux_getrandom(struct thread *td, struct linux_getrandom_args *args) in linux_getrandom() argument
2537 if (args->flags & ~(LINUX_GRND_NONBLOCK|LINUX_GRND_RANDOM)) in linux_getrandom()
2539 if (args->count > INT_MAX) in linux_getrandom()
2540 args->count = INT_MAX; in linux_getrandom()
2542 iov.iov_base = args->buf; in linux_getrandom()
2543 iov.iov_len = args->count; in linux_getrandom()
2552 error = read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK); in linux_getrandom()
2554 td->td_retval[0] = args->count - uio.uio_resid; in linux_getrandom()
2559 linux_mincore(struct thread *td, struct linux_mincore_args *args) in linux_mincore() argument
2563 if (args->start & PAGE_MASK) in linux_mincore()
2565 return (kern_mincore(td, args->start, args->len, args->vec)); in linux_mincore()
2571 linux_syslog(struct thread *td, struct linux_syslog_args *args) in linux_syslog() argument
2577 if (args->type != LINUX_SYSLOG_ACTION_READ_ALL) { in linux_syslog()
2578 linux_msg(td, "syslog unsupported type 0x%x", args->type); in linux_syslog()
2582 if (args->len < 6) { in linux_syslog()
2595 dst = args->buf; in linux_syslog()
2612 if (dst >= args->buf + args->len) in linux_syslog()
2619 dst + sizeof(SYSLOG_TAG) < args->buf + args->len) { in linux_syslog()
2627 td->td_retval[0] = dst - args->buf; in linux_syslog()
2632 linux_getcpu(struct thread *td, struct linux_getcpu_args *args) in linux_getcpu() argument
2640 if (args->cpu != NULL) in linux_getcpu()
2641 error = copyout(&cpu, args->cpu, sizeof(l_int)); in linux_getcpu()
2642 if (args->node != NULL) in linux_getcpu()
2643 error = copyout(&node, args->node, sizeof(l_int)); in linux_getcpu()