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()
234 linux_select(struct thread *td, struct linux_select_args *args) in linux_select() argument
244 if (args->timeout) { in linux_select()
245 if ((error = copyin(args->timeout, &ltv, sizeof(ltv)))) in linux_select()
269 error = kern_select(td, args->nfds, args->readfds, args->writefds, in linux_select()
270 args->exceptfds, tvp, LINUX_NFDBITS); in linux_select()
274 if (args->timeout) { in linux_select()
291 if ((error = copyout(&ltv, args->timeout, sizeof(ltv)))) in linux_select()
301 linux_mremap(struct thread *td, struct linux_mremap_args *args) in linux_mremap() argument
307 if (args->flags & ~(LINUX_MREMAP_FIXED | LINUX_MREMAP_MAYMOVE)) { in linux_mremap()
316 if (args->addr & PAGE_MASK) { in linux_mremap()
321 args->new_len = round_page(args->new_len); in linux_mremap()
322 args->old_len = round_page(args->old_len); in linux_mremap()
324 if (args->new_len > args->old_len) { in linux_mremap()
329 if (args->new_len < args->old_len) { in linux_mremap()
330 addr = args->addr + args->new_len; in linux_mremap()
331 len = args->old_len - args->new_len; in linux_mremap()
335 td->td_retval[0] = error ? 0 : (uintptr_t)args->addr; in linux_mremap()
344 linux_msync(struct thread *td, struct linux_msync_args *args) in linux_msync() argument
347 return (kern_msync(td, args->addr, args->len, in linux_msync()
348 args->fl & ~LINUX_MS_SYNC)); in linux_msync()
386 linux_time(struct thread *td, struct linux_time_args *args) in linux_time() argument
394 if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm)))) in linux_time()
422 linux_times(struct thread *td, struct linux_times_args *args) in linux_times() argument
429 if (args->buf != NULL) { in linux_times()
444 if ((error = copyout(&tms, args->buf, sizeof(tms)))) in linux_times()
454 linux_newuname(struct thread *td, struct linux_newuname_args *args) in linux_newuname() argument
494 return (copyout(&utsname, args->buf, sizeof(utsname))); in linux_newuname()
504 linux_utime(struct thread *td, struct linux_utime_args *args) in linux_utime() argument
510 if (args->times) { in linux_utime()
511 if ((error = copyin(args->times, &lut, sizeof lut)) != 0) in linux_utime()
521 return (kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, in linux_utime()
528 linux_utimes(struct thread *td, struct linux_utimes_args *args) in linux_utimes() argument
534 if (args->tptr != NULL) { in linux_utimes()
535 if ((error = copyin(args->tptr, ltv, sizeof ltv)) != 0) in linux_utimes()
544 return (kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE, in linux_utimes()
610 linux_utimensat(struct thread *td, struct linux_utimensat_args *args) in linux_utimensat() argument
616 if (args->times != NULL) { in linux_utimensat()
617 error = copyin(args->times, l_times, sizeof(l_times)); in linux_utimensat()
631 return (linux_common_utimensat(td, args->dfd, args->pathname, in linux_utimensat()
632 timesp, args->flags)); in linux_utimensat()
665 linux_utimensat_time64(struct thread *td, struct linux_utimensat_time64_args *args) in linux_utimensat_time64() argument
671 if (args->times64 != NULL) { in linux_utimensat_time64()
672 error = copyin(args->times64, l_times, sizeof(l_times)); in linux_utimensat_time64()
686 return (linux_common_utimensat(td, args->dfd, args->pathname, in linux_utimensat_time64()
687 timesp, args->flags)); in linux_utimensat_time64()
693 linux_futimesat(struct thread *td, struct linux_futimesat_args *args) in linux_futimesat() argument
699 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; in linux_futimesat()
701 if (args->utimes != NULL) { in linux_futimesat()
702 if ((error = copyin(args->utimes, ltv, sizeof ltv)) != 0) in linux_futimesat()
711 return (kern_utimesat(td, dfd, args->filename, UIO_USERSPACE, in linux_futimesat()
760 linux_waitpid(struct thread *td, struct linux_waitpid_args *args) in linux_waitpid() argument
763 .pid = args->pid, in linux_waitpid()
764 .status = args->status, in linux_waitpid()
765 .options = args->options, in linux_waitpid()
774 linux_wait4(struct thread *td, struct linux_wait4_args *args) in linux_wait4() argument
779 if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | in linux_wait4()
784 if (args->pid == INT_MIN) in linux_wait4()
788 linux_to_bsd_waitopts(args->options, &options); in linux_wait4()
796 if (args->pid == WAIT_ANY) { in linux_wait4()
799 } else if (args->pid < 0) { in linux_wait4()
801 id = (id_t)-args->pid; in linux_wait4()
802 } else if (args->pid == 0) { in linux_wait4()
810 id = (id_t)args->pid; in linux_wait4()
813 return (linux_common_wait(td, idtype, id, args->status, options, in linux_wait4()
814 args->rusage, NULL)); in linux_wait4()
818 linux_waitid(struct thread *td, struct linux_waitid_args *args) in linux_waitid() argument
825 if (args->options & ~(LINUX_WNOHANG | LINUX_WNOWAIT | LINUX_WEXITED | in linux_waitid()
830 linux_to_bsd_waitopts(args->options, &options); in linux_waitid()
832 id = args->id; in linux_waitid()
833 switch (args->idtype) { in linux_waitid()
838 if (args->id <= 0) in linux_waitid()
843 if (linux_kernver(td) >= LINUX_KERNVER(5,4,0) && args->id == 0) { in linux_waitid()
848 } else if (args->id <= 0) in linux_waitid()
860 args->rusage, args->info); in linux_waitid()
868 linux_mknod(struct thread *td, struct linux_mknod_args *args) in linux_mknod() argument
872 switch (args->mode & S_IFMT) { in linux_mknod()
875 error = kern_mkfifoat(td, AT_FDCWD, args->path, UIO_USERSPACE, in linux_mknod()
876 args->mode); in linux_mknod()
881 error = kern_mknodat(td, AT_FDCWD, args->path, UIO_USERSPACE, in linux_mknod()
882 args->mode, linux_decode_dev(args->dev)); in linux_mknod()
890 args->mode |= S_IFREG; in linux_mknod()
893 error = kern_openat(td, AT_FDCWD, args->path, UIO_USERSPACE, in linux_mknod()
894 O_WRONLY | O_CREAT | O_TRUNC, args->mode); in linux_mknod()
908 linux_mknodat(struct thread *td, struct linux_mknodat_args *args) in linux_mknodat() argument
912 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; in linux_mknodat()
914 switch (args->mode & S_IFMT) { in linux_mknodat()
917 error = kern_mkfifoat(td, dfd, args->filename, UIO_USERSPACE, in linux_mknodat()
918 args->mode); in linux_mknodat()
923 error = kern_mknodat(td, dfd, args->filename, UIO_USERSPACE, in linux_mknodat()
924 args->mode, linux_decode_dev(args->dev)); in linux_mknodat()
932 args->mode |= S_IFREG; in linux_mknodat()
935 error = kern_openat(td, dfd, args->filename, UIO_USERSPACE, in linux_mknodat()
936 O_WRONLY | O_CREAT | O_TRUNC, args->mode); in linux_mknodat()
952 linux_personality(struct thread *td, struct linux_personality_args *args) in linux_personality() argument
961 if (args->per != 0xffffffff) in linux_personality()
962 pem->persona = args->per; in linux_personality()
1020 linux_nice(struct thread *td, struct linux_nice_args *args) in linux_nice() argument
1023 return (kern_setpriority(td, PRIO_PROCESS, 0, args->inc)); in linux_nice()
1028 linux_setgroups(struct thread *td, struct linux_setgroups_args *args) in linux_setgroups() argument
1036 ngrp = args->gidsetsize; in linux_setgroups()
1040 error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); in linux_setgroups()
1085 linux_getgroups(struct thread *td, struct linux_getgroups_args *args) in linux_getgroups() argument
1102 if ((ngrp = args->gidsetsize) == 0) { in linux_getgroups()
1118 error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t)); in linux_getgroups()
1153 linux_setrlimit(struct thread *td, struct linux_setrlimit_args *args) in linux_setrlimit() argument
1160 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_setrlimit()
1163 which = linux_to_bsd_resource[args->resource]; in linux_setrlimit()
1167 error = copyin(args->rlim, &rlim, sizeof(rlim)); in linux_setrlimit()
1178 linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args) in linux_old_getrlimit() argument
1184 if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { in linux_old_getrlimit()
1187 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_old_getrlimit()
1190 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_old_getrlimit()
1193 which = linux_to_bsd_resource[args->resource]; in linux_old_getrlimit()
1214 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_old_getrlimit()
1219 linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args) in linux_getrlimit() argument
1225 if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { in linux_getrlimit()
1228 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_getrlimit()
1231 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_getrlimit()
1234 which = linux_to_bsd_resource[args->resource]; in linux_getrlimit()
1242 return (copyout(&rlim, args->rlim, sizeof(rlim))); in linux_getrlimit()
1247 struct linux_sched_setscheduler_args *args) in linux_sched_setscheduler() argument
1253 switch (args->policy) { in linux_sched_setscheduler()
1267 error = copyin(args->param, &sched_param, sizeof(sched_param)); in linux_sched_setscheduler()
1298 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_setscheduler()
1309 struct linux_sched_getscheduler_args *args) in linux_sched_getscheduler() argument
1314 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_getscheduler()
1337 struct linux_sched_get_priority_max_args *args) in linux_sched_get_priority_max() argument
1342 switch (args->policy) { in linux_sched_get_priority_max()
1355 switch (args->policy) { in linux_sched_get_priority_max()
1373 struct linux_sched_get_priority_min_args *args) in linux_sched_get_priority_min() argument
1378 switch (args->policy) { in linux_sched_get_priority_min()
1391 switch (args->policy) { in linux_sched_get_priority_min()
1419 linux_reboot(struct thread *td, struct linux_reboot_args *args) in linux_reboot() argument
1423 if (args->magic1 != REBOOT_MAGIC1) in linux_reboot()
1426 switch (args->magic2) { in linux_reboot()
1435 switch (args->cmd) { in linux_reboot()
1456 linux_getpid(struct thread *td, struct linux_getpid_args *args) in linux_getpid() argument
1465 linux_gettid(struct thread *td, struct linux_gettid_args *args) in linux_gettid() argument
1478 linux_getppid(struct thread *td, struct linux_getppid_args *args) in linux_getppid() argument
1486 linux_getgid(struct thread *td, struct linux_getgid_args *args) in linux_getgid() argument
1494 linux_getuid(struct thread *td, struct linux_getuid_args *args) in linux_getuid() argument
1502 linux_getsid(struct thread *td, struct linux_getsid_args *args) in linux_getsid() argument
1505 return (kern_getsid(td, args->pid)); in linux_getsid()
1509 linux_getpriority(struct thread *td, struct linux_getpriority_args *args) in linux_getpriority() argument
1513 error = kern_getpriority(td, args->which, args->who); in linux_getpriority()
1519 linux_sethostname(struct thread *td, struct linux_sethostname_args *args) in linux_sethostname() argument
1525 return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname, in linux_sethostname()
1526 args->len, 0, 0)); in linux_sethostname()
1530 linux_setdomainname(struct thread *td, struct linux_setdomainname_args *args) in linux_setdomainname() argument
1536 return (userland_sysctl(td, name, 2, 0, 0, 0, args->name, in linux_setdomainname()
1537 args->len, 0, 0)); in linux_setdomainname()
1541 linux_exit_group(struct thread *td, struct linux_exit_group_args *args) in linux_exit_group() argument
1545 args->error_code); in linux_exit_group()
1552 exit1(td, args->error_code, 0); in linux_exit_group()
1672 linux_prctl(struct thread *td, struct linux_prctl_args *args) in linux_prctl() argument
1679 switch (args->option) { in linux_prctl()
1681 if (!LINUX_SIG_VALID(args->arg2)) in linux_prctl()
1683 pdeath_signal = linux_to_bsd_signal(args->arg2); in linux_prctl()
1693 (void *)(register_t)args->arg2, in linux_prctl()
1723 switch (args->arg2) { in linux_prctl()
1758 error = copyinstr((void *)(register_t)args->arg2, comm, in linux_prctl()
1769 error = copyin((void *)(register_t)args->arg2, comm, in linux_prctl()
1784 error = copyout(comm, (void *)(register_t)args->arg2, in linux_prctl()
1800 (int)args->arg2); in linux_prctl()
1805 arg = args->arg2 == 1 ? in linux_prctl()
1815 linux_msg(td, "unsupported prctl option %d", args->option); in linux_prctl()
1930 struct linux_sched_getaffinity_args *args) in linux_sched_getaffinity() argument
1938 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_getaffinity()
1945 size = min(args->len, sizeof(cpuset_t)); in linux_sched_getaffinity()
1951 error = copyout(mask, args->user_mask_ptr, size); in linux_sched_getaffinity()
1963 struct linux_sched_setaffinity_args *args) in linux_sched_setaffinity() argument
1971 tdt = linux_tdfind(td, args->pid, -1); in linux_sched_setaffinity()
1977 len = min(args->len, sizeof(cpuset_t)); in linux_sched_setaffinity()
1979 error = copyin(args->user_mask_ptr, mask, len); in linux_sched_setaffinity()
2002 linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) in linux_prlimit64() argument
2011 if (args->new == NULL && args->old != NULL) { in linux_prlimit64()
2012 if (linux_get_dummy_limit(args->resource, &rlim)) { in linux_prlimit64()
2015 return (copyout(&lrlim, args->old, sizeof(lrlim))); in linux_prlimit64()
2019 if (args->resource >= LINUX_RLIM_NLIMITS) in linux_prlimit64()
2022 which = linux_to_bsd_resource[args->resource]; in linux_prlimit64()
2026 if (args->new != NULL) { in linux_prlimit64()
2032 error = copyin(args->new, &nrlim, sizeof(nrlim)); in linux_prlimit64()
2038 if (args->new != NULL) in linux_prlimit64()
2042 if (args->pid == 0) { in linux_prlimit64()
2046 error = pget(args->pid, flags, &p); in linux_prlimit64()
2050 if (args->old != NULL) { in linux_prlimit64()
2062 error = copyout(&lrlim, args->old, sizeof(lrlim)); in linux_prlimit64()
2067 if (args->new != NULL) in linux_prlimit64()
2076 linux_pselect6(struct thread *td, struct linux_pselect6_args *args) in linux_pselect6() argument
2081 if (args->tsp != NULL) { in linux_pselect6()
2082 error = linux_get_timespec(&ts, args->tsp); in linux_pselect6()
2089 error = linux_common_pselect6(td, args->nfds, args->readfds, in linux_pselect6()
2090 args->writefds, args->exceptfds, tsp, args->sig); in linux_pselect6()
2092 if (args->tsp != NULL) in linux_pselect6()
2093 linux_put_timespec(&ts, args->tsp); in linux_pselect6()
2157 struct linux_pselect6_time64_args *args) in linux_pselect6_time64() argument
2162 if (args->tsp != NULL) { in linux_pselect6_time64()
2163 error = linux_get_timespec64(&ts, args->tsp); in linux_pselect6_time64()
2170 error = linux_common_pselect6(td, args->nfds, args->readfds, in linux_pselect6_time64()
2171 args->writefds, args->exceptfds, tsp, args->sig); in linux_pselect6_time64()
2173 if (args->tsp != NULL) in linux_pselect6_time64()
2174 linux_put_timespec64(&ts, args->tsp); in linux_pselect6_time64()
2180 linux_ppoll(struct thread *td, struct linux_ppoll_args *args) in linux_ppoll() argument
2185 if (args->tsp != NULL) { in linux_ppoll()
2186 error = linux_get_timespec(&uts, args->tsp); in linux_ppoll()
2193 error = linux_common_ppoll(td, args->fds, args->nfds, tsp, in linux_ppoll()
2194 args->sset, args->ssize); in linux_ppoll()
2195 if (error == 0 && args->tsp != NULL) in linux_ppoll()
2196 error = linux_put_timespec(&uts, args->tsp); in linux_ppoll()
2253 linux_ppoll_time64(struct thread *td, struct linux_ppoll_time64_args *args) in linux_ppoll_time64() argument
2258 if (args->tsp != NULL) { in linux_ppoll_time64()
2259 error = linux_get_timespec64(&uts, args->tsp); in linux_ppoll_time64()
2265 error = linux_common_ppoll(td, args->fds, args->nfds, tsp, in linux_ppoll_time64()
2266 args->sset, args->ssize); in linux_ppoll_time64()
2267 if (error == 0 && args->tsp != NULL) in linux_ppoll_time64()
2268 error = linux_put_timespec64(&uts, args->tsp); in linux_ppoll_time64()
2430 linux_getrandom(struct thread *td, struct linux_getrandom_args *args) in linux_getrandom() argument
2436 if (args->flags & ~(LINUX_GRND_NONBLOCK|LINUX_GRND_RANDOM)) in linux_getrandom()
2438 if (args->count > INT_MAX) in linux_getrandom()
2439 args->count = INT_MAX; in linux_getrandom()
2441 iov.iov_base = args->buf; in linux_getrandom()
2442 iov.iov_len = args->count; in linux_getrandom()
2451 error = read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK); in linux_getrandom()
2453 td->td_retval[0] = args->count - uio.uio_resid; in linux_getrandom()
2458 linux_mincore(struct thread *td, struct linux_mincore_args *args) in linux_mincore() argument
2462 if (args->start & PAGE_MASK) in linux_mincore()
2464 return (kern_mincore(td, args->start, args->len, args->vec)); in linux_mincore()
2470 linux_syslog(struct thread *td, struct linux_syslog_args *args) in linux_syslog() argument
2476 if (args->type != LINUX_SYSLOG_ACTION_READ_ALL) { in linux_syslog()
2477 linux_msg(td, "syslog unsupported type 0x%x", args->type); in linux_syslog()
2481 if (args->len < 6) { in linux_syslog()
2494 dst = args->buf; in linux_syslog()
2511 if (dst >= args->buf + args->len) in linux_syslog()
2518 dst + sizeof(SYSLOG_TAG) < args->buf + args->len) { in linux_syslog()
2526 td->td_retval[0] = dst - args->buf; in linux_syslog()
2531 linux_getcpu(struct thread *td, struct linux_getcpu_args *args) in linux_getcpu() argument
2539 if (args->cpu != NULL) in linux_getcpu()
2540 error = copyout(&cpu, args->cpu, sizeof(l_int)); in linux_getcpu()
2541 if (args->node != NULL) in linux_getcpu()
2542 error = copyout(&node, args->node, sizeof(l_int)); in linux_getcpu()
2548 linux_poll(struct thread *td, struct linux_poll_args *args) in linux_poll() argument
2552 if (args->timeout != INFTIM) { in linux_poll()
2553 if (args->timeout < 0) in linux_poll()
2555 ts.tv_sec = args->timeout / 1000; in linux_poll()
2556 ts.tv_nsec = (args->timeout % 1000) * 1000000; in linux_poll()
2561 return (linux_common_ppoll(td, args->fds, args->nfds, in linux_poll()
2567 linux_seccomp(struct thread *td, struct linux_seccomp_args *args) in linux_seccomp() argument
2570 switch (args->op) { in linux_seccomp()
2588 linux_exec_copyin_args(struct image_args *args, const char *fname, in linux_exec_copyin_args() argument
2595 bzero(args, sizeof(*args)); in linux_exec_copyin_args()
2603 error = exec_alloc_args(args); in linux_exec_copyin_args()
2610 error = exec_args_add_fname(args, fname, segflg); in linux_exec_copyin_args()
2625 error = exec_args_add_arg(args, argp, UIO_USERSPACE); in linux_exec_copyin_args()
2636 if (args->argc == 0 && in linux_exec_copyin_args()
2637 (error = exec_args_add_arg(args, "", UIO_SYSSPACE) != 0)) in linux_exec_copyin_args()
2652 error = exec_args_add_env(args, envp, UIO_USERSPACE); in linux_exec_copyin_args()
2661 exec_free_args(args); in linux_exec_copyin_args()
2666 linux_execve(struct thread *td, struct linux_execve_args *args) in linux_execve() argument
2673 error = linux_exec_copyin_args(&eargs, args->path, UIO_USERSPACE, in linux_execve()
2674 args->argp, args->envp); in linux_execve()
2748 linux_ioprio_get(struct thread *td, struct linux_ioprio_get_args *args) in linux_ioprio_get() argument
2762 switch (args->which) { in linux_ioprio_get()
2764 if (args->who == 0) { in linux_ioprio_get()
2768 } else if (args->who > PID_MAX) { in linux_ioprio_get()
2769 td1 = linux_tdfind(td, args->who, -1); in linux_ioprio_get()
2773 p = pfind(args->who); in linux_ioprio_get()
2792 if (args->who == 0) { in linux_ioprio_get()
2796 pg = pgfind(args->who); in linux_ioprio_get()
2818 if (args->who == 0) in linux_ioprio_get()
2819 args->who = td->td_ucred->cr_uid; in linux_ioprio_get()
2824 p->p_ucred->cr_uid == args->who && in linux_ioprio_get()
2849 linux_ioprio_set(struct thread *td, struct linux_ioprio_set_args *args) in linux_ioprio_set() argument
2857 if ((error = linux_ioprio2rtprio(args->ioprio, &rtp)) != 0) in linux_ioprio_set()
2866 switch (args->which) { in linux_ioprio_set()
2868 if (args->who == 0) { in linux_ioprio_set()
2872 } else if (args->who > PID_MAX) { in linux_ioprio_set()
2873 td1 = linux_tdfind(td, args->who, -1); in linux_ioprio_set()
2877 p = pfind(args->who); in linux_ioprio_set()
2896 if (args->who == 0) { in linux_ioprio_set()
2900 pg = pgfind(args->who); in linux_ioprio_set()
2924 if (args->who == 0) in linux_ioprio_set()
2925 args->who = td->td_ucred->cr_uid; in linux_ioprio_set()
2930 p->p_ucred->cr_uid == args->who && in linux_ioprio_set()