diff options
author | alfred <alfred@FreeBSD.org> | 2002-12-13 22:41:47 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-12-13 22:41:47 +0000 |
commit | 4f48184fb2c8948c406b21c3f802b5b281cef957 (patch) | |
tree | a1ef524330ea7e253fb665abea3ddb594cde69fc /sys/kern | |
parent | d19b4e039d47537b44233aae83d03b974d29d771 (diff) | |
download | FreeBSD-src-4f48184fb2c8948c406b21c3f802b5b281cef957.zip FreeBSD-src-4f48184fb2c8948c406b21c3f802b5b281cef957.tar.gz |
Backout removal SCARGS, the code freeze is only "selectively" over.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_acct.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_acl.c | 38 | ||||
-rw-r--r-- | sys/kern/kern_environment.c | 28 | ||||
-rw-r--r-- | sys/kern/kern_linker.c | 28 | ||||
-rw-r--r-- | sys/kern/kern_mac.c | 10 | ||||
-rw-r--r-- | sys/kern/kern_module.c | 12 | ||||
-rw-r--r-- | sys/kern/kern_time.c | 24 | ||||
-rw-r--r-- | sys/kern/subr_acl_posix1e.c | 38 | ||||
-rw-r--r-- | sys/kern/sys_generic.c | 12 | ||||
-rw-r--r-- | sys/kern/vfs_acl.c | 38 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 170 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 16 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 170 |
13 files changed, 295 insertions, 295 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index c2554b6..9188e30 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -139,8 +139,8 @@ acct(td, uap) * If accounting is to be started to a file, open that file for * appending and make sure it's a 'normal'. */ - if (uap->path != NULL) { - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, + if (SCARG(uap, path) != NULL) { + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), td); flags = FWRITE | O_APPEND; error = vn_open(&nd, &flags, 0); @@ -187,7 +187,7 @@ acct(td, uap) crfree(acctcred != NOCRED ? acctcred : savacctcred); acctcred = savacctcred = NOCRED; } - if (uap->path == NULL) { + if (SCARG(uap, path) == NULL) { mtx_unlock(&acct_mtx); goto done2; } diff --git a/sys/kern/kern_acl.c b/sys/kern/kern_acl.c index b194454..2a182cd 100644 --- a/sys/kern/kern_acl.c +++ b/sys/kern/kern_acl.c @@ -689,11 +689,11 @@ __acl_get_file(struct thread *td, struct __acl_get_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_get_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -712,11 +712,11 @@ __acl_set_file(struct thread *td, struct __acl_set_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_set_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -735,10 +735,10 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_get_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -757,10 +757,10 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_set_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -779,10 +779,10 @@ __acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); + error = vacl_delete(td, nd.ni_vp, SCARG(uap, type)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -801,10 +801,10 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_delete(td, (struct vnode *)fp->f_data, - uap->type); + SCARG(uap, type)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -823,11 +823,11 @@ __acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_aclcheck(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -846,10 +846,10 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_aclcheck(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 6f71739..04f00c3 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -92,7 +92,7 @@ kenv(td, uap) KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = 0")); error = 0; - if (uap->what == KENV_DUMP) { + if (SCARG(uap, what) == KENV_DUMP) { #ifdef MAC error = mac_check_kenv_dump(td->td_ucred); if (error) @@ -100,7 +100,7 @@ kenv(td, uap) #endif len = 0; /* Return the size if called with a NULL buffer */ - if (uap->value == NULL) { + if (SCARG(uap, value) == NULL) { sx_slock(&kenv_lock); for (i = 0; kenvp[i] != NULL; i++) len += strlen(kenvp[i]) + 1; @@ -110,9 +110,9 @@ kenv(td, uap) } done = 0; sx_slock(&kenv_lock); - for (i = 0; kenvp[i] != NULL && done < uap->len; i++) { - len = min(strlen(kenvp[i]) + 1, uap->len - done); - error = copyout(kenvp[i], uap->value + done, + for (i = 0; kenvp[i] != NULL && done < SCARG(uap, len); i++) { + len = min(strlen(kenvp[i]) + 1, SCARG(uap, len) - done); + error = copyout(kenvp[i], SCARG(uap, value) + done, len); if (error) { sx_sunlock(&kenv_lock); @@ -124,8 +124,8 @@ kenv(td, uap) return (0); } - if ((uap->what == KENV_SET) || - (uap->what == KENV_UNSET)) { + if ((SCARG(uap, what) == KENV_SET) || + (SCARG(uap, what) == KENV_UNSET)) { error = suser(td); if (error) return (error); @@ -133,11 +133,11 @@ kenv(td, uap) name = malloc(KENV_MNAMELEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->name, name, KENV_MNAMELEN, NULL); + error = copyinstr(SCARG(uap, name), name, KENV_MNAMELEN, NULL); if (error) goto done; - switch (uap->what) { + switch (SCARG(uap, what)) { case KENV_GET: #ifdef MAC error = mac_check_kenv_get(td->td_ucred, name); @@ -150,16 +150,16 @@ kenv(td, uap) goto done; } len = strlen(value) + 1; - if (len > uap->len) - len = uap->len; - error = copyout(value, uap->value, len); + if (len > SCARG(uap, len)) + len = SCARG(uap, len); + error = copyout(value, SCARG(uap, value), len); freeenv(value); if (error) goto done; td->td_retval[0] = len; break; case KENV_SET: - len = uap->len; + len = SCARG(uap, len); if (len < 1) { error = EINVAL; goto done; @@ -167,7 +167,7 @@ kenv(td, uap) if (len > KENV_MVALLEN) len = KENV_MVALLEN; value = malloc(len, M_TEMP, M_WAITOK); - error = copyinstr(uap->value, value, len, NULL); + error = copyinstr(SCARG(uap, value), value, len, NULL); if (error) { free(value, M_TEMP); goto done; diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index f387959..eab20b1 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -754,7 +754,7 @@ kldload(struct thread *td, struct kldload_args *uap) goto out; pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - if ((error = copyinstr(uap->file, pathname, MAXPATHLEN, + if ((error = copyinstr(SCARG(uap, file), pathname, MAXPATHLEN, NULL)) != 0) goto out; @@ -800,7 +800,7 @@ kldunload(struct thread *td, struct kldunload_args *uap) if ((error = suser(td)) != 0) goto out; - lf = linker_find_file_by_id(uap->fileid); + lf = linker_find_file_by_id(SCARG(uap, fileid)); if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); if (lf->userrefs == 0) { @@ -841,7 +841,7 @@ kldfind(struct thread *td, struct kldfind_args *uap) td->td_retval[0] = -1; pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - if ((error = copyinstr(uap->file, pathname, MAXPATHLEN, + if ((error = copyinstr(SCARG(uap, file), pathname, MAXPATHLEN, NULL)) != 0) goto out; @@ -875,7 +875,7 @@ kldnext(struct thread *td, struct kldnext_args *uap) mtx_lock(&Giant); - if (uap->fileid == 0) { + if (SCARG(uap, fileid) == 0) { mtx_lock(&kld_mtx); if (TAILQ_FIRST(&linker_files)) td->td_retval[0] = TAILQ_FIRST(&linker_files)->id; @@ -884,7 +884,7 @@ kldnext(struct thread *td, struct kldnext_args *uap) mtx_unlock(&kld_mtx); goto out; } - lf = linker_find_file_by_id(uap->fileid); + lf = linker_find_file_by_id(SCARG(uap, fileid)); if (lf) { if (TAILQ_NEXT(lf, link)) td->td_retval[0] = TAILQ_NEXT(lf, link)->id; @@ -916,12 +916,12 @@ kldstat(struct thread *td, struct kldstat_args *uap) mtx_lock(&Giant); - lf = linker_find_file_by_id(uap->fileid); + lf = linker_find_file_by_id(SCARG(uap, fileid)); if (lf == NULL) { error = ENOENT; goto out; } - stat = uap->stat; + stat = SCARG(uap, stat); /* * Check the version of the user's structure. @@ -970,7 +970,7 @@ kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) #endif mtx_lock(&Giant); - lf = linker_find_file_by_id(uap->fileid); + lf = linker_find_file_by_id(SCARG(uap, fileid)); if (lf) { MOD_SLOCK; mp = TAILQ_FIRST(&lf->modules); @@ -1006,18 +1006,18 @@ kldsym(struct thread *td, struct kldsym_args *uap) mtx_lock(&Giant); - if ((error = copyin(uap->data, &lookup, sizeof(lookup))) != 0) + if ((error = copyin(SCARG(uap, data), &lookup, sizeof(lookup))) != 0) goto out; if (lookup.version != sizeof(lookup) || - uap->cmd != KLDSYM_LOOKUP) { + SCARG(uap, cmd) != KLDSYM_LOOKUP) { error = EINVAL; goto out; } symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); if ((error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL)) != 0) goto out; - if (uap->fileid != 0) { - lf = linker_find_file_by_id(uap->fileid); + if (SCARG(uap, fileid) != 0) { + lf = linker_find_file_by_id(SCARG(uap, fileid)); if (lf == NULL) { error = ENOENT; goto out; @@ -1026,7 +1026,7 @@ kldsym(struct thread *td, struct kldsym_args *uap) LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) { lookup.symvalue = (uintptr_t) symval.value; lookup.symsize = symval.size; - error = copyout(&lookup, uap->data, + error = copyout(&lookup, SCARG(uap, data), sizeof(lookup)); } else error = ENOENT; @@ -1037,7 +1037,7 @@ kldsym(struct thread *td, struct kldsym_args *uap) LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) { lookup.symvalue = (uintptr_t)symval.value; lookup.symsize = symval.size; - error = copyout(&lookup, uap->data, + error = copyout(&lookup, SCARG(uap, data), sizeof(lookup)); break; } diff --git a/sys/kern/kern_mac.c b/sys/kern/kern_mac.c index 6542a73..257d131 100644 --- a/sys/kern/kern_mac.c +++ b/sys/kern/kern_mac.c @@ -3020,7 +3020,7 @@ __mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) struct ucred *tcred; int error; - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = copyin(SCARG(uap, mac_p), &mac, sizeof(mac)); if (error) return (error); @@ -3203,7 +3203,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); mtx_lock(&Giant); /* VFS */ - error = fget(td, uap->fd, &fp); + error = fget(td, SCARG(uap, fd), &fp); if (error) goto out; @@ -3405,7 +3405,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) mtx_lock(&Giant); /* VFS */ - error = fget(td, uap->fd, &fp); + error = fget(td, SCARG(uap, fd), &fp); if (error) goto out; @@ -3583,7 +3583,7 @@ mac_syscall(struct thread *td, struct mac_syscall_args *uap) char target[MAC_MAX_POLICY_NAME]; int error; - error = copyinstr(uap->policy, target, sizeof(target), NULL); + error = copyinstr(SCARG(uap, policy), target, sizeof(target), NULL); if (error) return (error); @@ -3593,7 +3593,7 @@ mac_syscall(struct thread *td, struct mac_syscall_args *uap) if (strcmp(mpc->mpc_name, target) == 0 && mpc->mpc_ops->mpo_syscall != NULL) { error = mpc->mpc_ops->mpo_syscall(td, - uap->call, uap->arg); + SCARG(uap, call), SCARG(uap, arg)); goto out; } } diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index e39f56a..74a0259 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -259,7 +259,7 @@ modnext(struct thread *td, struct modnext_args *uap) td->td_retval[0] = -1; MOD_SLOCK; - if (uap->modid == 0) { + if (SCARG(uap, modid) == 0) { mod = TAILQ_FIRST(&modules); if (mod) td->td_retval[0] = mod->id; @@ -267,7 +267,7 @@ modnext(struct thread *td, struct modnext_args *uap) error = ENOENT; goto done2; } - mod = module_lookupbyid(uap->modid); + mod = module_lookupbyid(SCARG(uap, modid)); if (mod == NULL) { error = ENOENT; goto done2; @@ -293,7 +293,7 @@ modfnext(struct thread *td, struct modfnext_args *uap) td->td_retval[0] = -1; MOD_SLOCK; - mod = module_lookupbyid(uap->modid); + mod = module_lookupbyid(SCARG(uap, modid)); if (mod == NULL) { error = ENOENT; } else { @@ -328,7 +328,7 @@ modstat(struct thread *td, struct modstat_args *uap) char *name; MOD_SLOCK; - mod = module_lookupbyid(uap->modid); + mod = module_lookupbyid(SCARG(uap, modid)); if (mod == NULL) { MOD_SUNLOCK; return (ENOENT); @@ -338,7 +338,7 @@ modstat(struct thread *td, struct modstat_args *uap) name = mod->name; data = mod->data; MOD_SUNLOCK; - stat = uap->stat; + stat = SCARG(uap, stat); /* * Check the version of the user's structure. @@ -380,7 +380,7 @@ modfind(struct thread *td, struct modfind_args *uap) char name[MAXMODNAME]; module_t mod; - if ((error = copyinstr(uap->name, name, sizeof name, 0)) != 0) + if ((error = copyinstr(SCARG(uap, name), name, sizeof name, 0)) != 0) return (error); MOD_SLOCK; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 27b1fdd..865ee0a 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -159,12 +159,12 @@ clock_gettime(struct thread *td, struct clock_gettime_args *uap) { struct timespec ats; - if (uap->clock_id != CLOCK_REALTIME) + if (SCARG(uap, clock_id) != CLOCK_REALTIME) return (EINVAL); mtx_lock(&Giant); nanotime(&ats); mtx_unlock(&Giant); - return (copyout(&ats, uap->tp, sizeof(ats))); + return (copyout(&ats, SCARG(uap, tp), sizeof(ats))); } #ifndef _SYS_SYSPROTO_H_ @@ -192,9 +192,9 @@ clock_settime(struct thread *td, struct clock_settime_args *uap) #endif if ((error = suser(td)) != 0) return (error); - if (uap->clock_id != CLOCK_REALTIME) + if (SCARG(uap, clock_id) != CLOCK_REALTIME) return (EINVAL); - if ((error = copyin(uap->tp, &ats, sizeof(ats))) != 0) + if ((error = copyin(SCARG(uap, tp), &ats, sizeof(ats))) != 0) return (error); if (ats.tv_nsec < 0 || ats.tv_nsec >= 1000000000) return (EINVAL); @@ -217,10 +217,10 @@ clock_getres(struct thread *td, struct clock_getres_args *uap) struct timespec ts; int error; - if (uap->clock_id != CLOCK_REALTIME) + if (SCARG(uap, clock_id) != CLOCK_REALTIME) return (EINVAL); error = 0; - if (uap->tp) { + if (SCARG(uap, tp)) { ts.tv_sec = 0; /* * Round up the result of the division cheaply by adding 1. @@ -228,7 +228,7 @@ clock_getres(struct thread *td, struct clock_getres_args *uap) * would give 0. Perfect rounding is unimportant. */ ts.tv_nsec = 1000000000 / tc_getfrequency() + 1; - error = copyout(&ts, uap->tp, sizeof(ts)); + error = copyout(&ts, SCARG(uap, tp), sizeof(ts)); } return (error); } @@ -289,23 +289,23 @@ nanosleep(struct thread *td, struct nanosleep_args *uap) struct timespec rmt, rqt; int error; - error = copyin(uap->rqtp, &rqt, sizeof(rqt)); + error = copyin(SCARG(uap, rqtp), &rqt, sizeof(rqt)); if (error) return (error); mtx_lock(&Giant); - if (uap->rmtp) { - if (!useracc((caddr_t)uap->rmtp, sizeof(rmt), + if (SCARG(uap, rmtp)) { + if (!useracc((caddr_t)SCARG(uap, rmtp), sizeof(rmt), VM_PROT_WRITE)) { error = EFAULT; goto done2; } } error = nanosleep1(td, &rqt, &rmt); - if (error && uap->rmtp) { + if (error && SCARG(uap, rmtp)) { int error2; - error2 = copyout(&rmt, uap->rmtp, sizeof(rmt)); + error2 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt)); if (error2) /* XXX shouldn't happen, did useracc() above */ error = error2; } diff --git a/sys/kern/subr_acl_posix1e.c b/sys/kern/subr_acl_posix1e.c index b194454..2a182cd 100644 --- a/sys/kern/subr_acl_posix1e.c +++ b/sys/kern/subr_acl_posix1e.c @@ -689,11 +689,11 @@ __acl_get_file(struct thread *td, struct __acl_get_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_get_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -712,11 +712,11 @@ __acl_set_file(struct thread *td, struct __acl_set_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_set_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -735,10 +735,10 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_get_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -757,10 +757,10 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_set_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -779,10 +779,10 @@ __acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); + error = vacl_delete(td, nd.ni_vp, SCARG(uap, type)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -801,10 +801,10 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_delete(td, (struct vnode *)fp->f_data, - uap->type); + SCARG(uap, type)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -823,11 +823,11 @@ __acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_aclcheck(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -846,10 +846,10 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_aclcheck(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index c26cf47..b74a74b 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -951,7 +951,7 @@ poll(td, uap) u_int ncoll, nfds; size_t ni; - nfds = uap->nfds; + nfds = SCARG(uap, nfds); mtx_lock(&Giant); /* @@ -971,12 +971,12 @@ poll(td, uap) bits = malloc(ni, M_TEMP, M_WAITOK); else bits = smallbits; - error = copyin(uap->fds, bits, ni); + error = copyin(SCARG(uap, fds), bits, ni); if (error) goto done_nosellock; - if (uap->timeout != INFTIM) { - atv.tv_sec = uap->timeout / 1000; - atv.tv_usec = (uap->timeout % 1000) * 1000; + if (SCARG(uap, timeout) != INFTIM) { + atv.tv_sec = SCARG(uap, timeout) / 1000; + atv.tv_usec = (SCARG(uap, timeout) % 1000) * 1000; if (itimerfix(&atv)) { error = EINVAL; goto done_nosellock; @@ -1044,7 +1044,7 @@ done_nosellock: if (error == EWOULDBLOCK) error = 0; if (error == 0) { - error = copyout(bits, uap->fds, ni); + error = copyout(bits, SCARG(uap, fds), ni); if (error) goto out; } diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index b194454..2a182cd 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -689,11 +689,11 @@ __acl_get_file(struct thread *td, struct __acl_get_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_get_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_get_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -712,11 +712,11 @@ __acl_set_file(struct thread *td, struct __acl_set_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_set_acl(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_set_acl(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -735,10 +735,10 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_get_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -757,10 +757,10 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_set_acl(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -779,10 +779,10 @@ __acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_delete(td, nd.ni_vp, uap->type); + error = vacl_delete(td, nd.ni_vp, SCARG(uap, type)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -801,10 +801,10 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_delete(td, (struct vnode *)fp->f_data, - uap->type); + SCARG(uap, type)); fdrop(fp, td); } mtx_unlock(&Giant); @@ -823,11 +823,11 @@ __acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) int error; mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); error = namei(&nd); if (error == 0) { - error = vacl_aclcheck(td, nd.ni_vp, uap->type, - uap->aclp); + error = vacl_aclcheck(td, nd.ni_vp, SCARG(uap, type), + SCARG(uap, aclp)); NDFREE(&nd, 0); } mtx_unlock(&Giant); @@ -846,10 +846,10 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) int error; mtx_lock(&Giant); - error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); + error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); if (error == 0) { error = vacl_aclcheck(td, (struct vnode *)fp->f_data, - uap->type, uap->aclp); + SCARG(uap, type), SCARG(uap, aclp)); fdrop(fp, td); } mtx_unlock(&Giant); diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 012cc91..8e2d605 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -191,7 +191,7 @@ quotactl(td, uap) if (jailed(td->td_ucred) && !prison_quotas) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -199,8 +199,8 @@ quotactl(td, uap) vrele(nd.ni_vp); if (error) return (error); - error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, - uap->arg, td); + error = VFS_QUOTACTL(mp, SCARG(uap, cmd), SCARG(uap, uid), + SCARG(uap, arg), td); vn_finished_write(mp); return (error); } @@ -229,7 +229,7 @@ statfs(td, uap) struct nameidata nd; struct statfs sb; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); mp = nd.ni_vp->v_mount; @@ -250,7 +250,7 @@ statfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* @@ -277,7 +277,7 @@ fstatfs(td, uap) int error; struct statfs sb; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); mp = ((struct vnode *)fp->f_data)->v_mount; fdrop(fp, td); @@ -298,7 +298,7 @@ fstatfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* @@ -325,8 +325,8 @@ getfsstat(td, uap) caddr_t sfsp; long count, maxcount, error; - maxcount = uap->bufsize / sizeof(struct statfs); - sfsp = (caddr_t)uap->buf; + maxcount = SCARG(uap, bufsize) / sizeof(struct statfs); + sfsp = (caddr_t)SCARG(uap, buf); count = 0; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -347,8 +347,8 @@ getfsstat(td, uap) * refresh the fsstat cache. MNT_NOWAIT or MNT_LAZY * overrides MNT_WAIT. */ - if (((uap->flags & (MNT_LAZY|MNT_NOWAIT)) == 0 || - (uap->flags & MNT_WAIT)) && + if (((SCARG(uap, flags) & (MNT_LAZY|MNT_NOWAIT)) == 0 || + (SCARG(uap, flags) & MNT_WAIT)) && (error = VFS_STATFS(mp, sp, td))) { mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); @@ -398,7 +398,7 @@ fchdir(td, uap) struct file *fp; int error; - if ((error = getvnode(fdp, uap->fd, &fp)) != 0) + if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; VREF(vp); @@ -539,7 +539,7 @@ chroot(td, uap) if (error) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); mtx_lock(&Giant); if ((error = change_dir(&nd, td)) != 0) goto error; @@ -809,9 +809,9 @@ ocreat(td, uap) syscallarg(int) mode; } */ nuap; - nuap.path = uap->path; - nuap.mode = uap->mode; - nuap.flags = O_WRONLY | O_CREAT | O_TRUNC; + SCARG(&nuap, path) = SCARG(uap, path); + SCARG(&nuap, mode) = SCARG(uap, mode); + SCARG(&nuap, flags) = O_WRONLY | O_CREAT | O_TRUNC; return (open(td, &nuap)); } #endif /* COMPAT_43 */ @@ -1176,7 +1176,7 @@ undelete(td, uap) restart: bwillwrite(); NDINIT(&nd, DELETE, LOCKPARENT|DOWHITEOUT, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); error = namei(&nd); if (error) return (error); @@ -1222,7 +1222,7 @@ unlink(td, uap) } */ *uap; { - return (kern_unlink(td, uap->path, UIO_USERSPACE)); + return (kern_unlink(td, SCARG(uap, path), UIO_USERSPACE)); } int @@ -1323,8 +1323,8 @@ lseek(td, uap) } vp = (struct vnode *)fp->f_data; noneg = (vp->v_type != VCHR); - offset = uap->offset; - switch (uap->whence) { + offset = SCARG(uap, offset); + switch (SCARG(uap, whence)) { case L_INCR: if (noneg && (fp->f_offset < 0 || @@ -1386,9 +1386,9 @@ olseek(td, uap) } */ nuap; int error; - nuap.fd = uap->fd; - nuap.offset = uap->offset; - nuap.whence = uap->whence; + SCARG(&nuap, fd) = SCARG(uap, fd); + SCARG(&nuap, offset) = SCARG(uap, offset); + SCARG(&nuap, whence) = SCARG(uap, whence); error = lseek(td, &nuap); return (error); } @@ -1506,12 +1506,12 @@ eaccess(td, uap) int error; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; - error = vn_access(vp, uap->flags, td->td_ucred, td); + error = vn_access(vp, SCARG(uap, flags), td->td_ucred, td); NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); return (error); @@ -1542,7 +1542,7 @@ ostat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1551,7 +1551,7 @@ ostat(td, uap) if (error) return (error); cvtstat(&sb, &osb); - error = copyout(&osb, uap->ub, sizeof (osb)); + error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); } @@ -1580,7 +1580,7 @@ olstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1590,7 +1590,7 @@ olstat(td, uap) if (error) return (error); cvtstat(&sb, &osb); - error = copyout(&osb, uap->ub, sizeof (osb)); + error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); } @@ -1648,10 +1648,10 @@ stat(td, uap) #ifdef LOOKUP_SHARED NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | NOOBJ, - UIO_USERSPACE, uap->path, td); + UIO_USERSPACE, SCARG(uap, path), td); #else NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); #endif if ((error = namei(&nd)) != 0) return (error); @@ -1660,7 +1660,7 @@ stat(td, uap) vput(nd.ni_vp); if (error) return (error); - error = copyout(&sb, uap->ub, sizeof (sb)); + error = copyout(&sb, SCARG(uap, ub), sizeof (sb)); return (error); } @@ -1688,7 +1688,7 @@ lstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1697,7 +1697,7 @@ lstat(td, uap) vput(vp); if (error) return (error); - error = copyout(&sb, uap->ub, sizeof (sb)); + error = copyout(&sb, SCARG(uap, ub), sizeof (sb)); return (error); } @@ -1753,7 +1753,7 @@ nstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1762,7 +1762,7 @@ nstat(td, uap) if (error) return (error); cvtnstat(&sb, &nsb); - error = copyout(&nsb, uap->ub, sizeof (nsb)); + error = copyout(&nsb, SCARG(uap, ub), sizeof (nsb)); return (error); } @@ -1791,7 +1791,7 @@ nlstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1801,7 +1801,7 @@ nlstat(td, uap) if (error) return (error); cvtnstat(&sb, &nsb); - error = copyout(&nsb, uap->ub, sizeof (nsb)); + error = copyout(&nsb, SCARG(uap, ub), sizeof (nsb)); return (error); } @@ -1827,7 +1827,7 @@ pathconf(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1972,11 +1972,11 @@ chflags(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfflags(td, nd.ni_vp, uap->flags); + error = setfflags(td, nd.ni_vp, SCARG(uap, flags)); vrele(nd.ni_vp); return error; } @@ -1995,11 +1995,11 @@ lchflags(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfflags(td, nd.ni_vp, uap->flags); + error = setfflags(td, nd.ni_vp, SCARG(uap, flags)); vrele(nd.ni_vp); return error; } @@ -2025,9 +2025,9 @@ fchflags(td, uap) struct file *fp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); - error = setfflags(td, (struct vnode *) fp->f_data, uap->flags); + error = setfflags(td, (struct vnode *) fp->f_data, SCARG(uap, flags)); fdrop(fp, td); return (error); } @@ -2119,11 +2119,11 @@ lchmod(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfmode(td, nd.ni_vp, uap->mode); + error = setfmode(td, nd.ni_vp, SCARG(uap, mode)); vrele(nd.ni_vp); return error; } @@ -2150,10 +2150,10 @@ fchmod(td, uap) struct vnode *vp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; - error = setfmode(td, (struct vnode *)fp->f_data, uap->mode); + error = setfmode(td, (struct vnode *)fp->f_data, SCARG(uap, mode)); fdrop(fp, td); return (error); } @@ -2294,11 +2294,11 @@ fchown(td, uap) struct vnode *vp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; error = setfown(td, (struct vnode *)fp->f_data, - uap->uid, uap->gid); + SCARG(uap, uid), SCARG(uap, gid)); fdrop(fp, td); return (error); } @@ -2592,7 +2592,7 @@ ftruncate(td, uap) if (uap->length < 0) return(EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FWRITE) == 0) { fdrop(fp, td); @@ -2614,7 +2614,7 @@ ftruncate(td, uap) #endif else if ((error = vn_writechk(vp)) == 0) { VATTR_NULL(&vattr); - vattr.va_size = uap->length; + vattr.va_size = SCARG(uap, length); error = VOP_SETATTR(vp, &vattr, fp->f_cred, td); } VOP_UNLOCK(vp, 0, td); @@ -2648,8 +2648,8 @@ otruncate(td, uap) syscallarg(off_t) length; } */ nuap; - nuap.path = uap->path; - nuap.length = uap->length; + SCARG(&nuap, path) = SCARG(uap, path); + SCARG(&nuap, length) = SCARG(uap, length); return (truncate(td, &nuap)); } @@ -2677,8 +2677,8 @@ oftruncate(td, uap) syscallarg(off_t) length; } */ nuap; - nuap.fd = uap->fd; - nuap.length = uap->length; + SCARG(&nuap, fd) = SCARG(uap, fd); + SCARG(&nuap, length) = SCARG(uap, length); return (ftruncate(td, &nuap)); } #endif /* COMPAT_43 || COMPAT_SUNOS */ @@ -2707,7 +2707,7 @@ fsync(td, uap) GIANT_REQUIRED; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { @@ -3062,9 +3062,9 @@ ogetdirentries(td, uap) long loff; /* XXX arbitrary sanity limit on `count'. */ - if (uap->count > 64 * 1024) + if (SCARG(uap, count) > 64 * 1024) return (EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -3076,14 +3076,14 @@ unionread: fdrop(fp, td); return (EINVAL); } - aiov.iov_base = uap->buf; - aiov.iov_len = uap->count; + aiov.iov_base = SCARG(uap, buf); + aiov.iov_len = SCARG(uap, count); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap->count; + auio.uio_resid = SCARG(uap, count); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); loff = auio.uio_offset = fp->f_offset; #ifdef MAC @@ -3105,14 +3105,14 @@ unionread: kuio = auio; kuio.uio_iov = &kiov; kuio.uio_segflg = UIO_SYSSPACE; - kiov.iov_len = uap->count; - MALLOC(dirbuf, caddr_t, uap->count, M_TEMP, M_WAITOK); + kiov.iov_len = SCARG(uap, count); + MALLOC(dirbuf, caddr_t, SCARG(uap, count), M_TEMP, M_WAITOK); kiov.iov_base = dirbuf; error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag, NULL, NULL); fp->f_offset = kuio.uio_offset; if (error == 0) { - readcnt = uap->count - kuio.uio_resid; + readcnt = SCARG(uap, count) - kuio.uio_resid; edp = (struct dirent *)&dirbuf[readcnt]; for (dp = (struct dirent *)dirbuf; dp < edp; ) { # if (BYTE_ORDER == LITTLE_ENDIAN) @@ -3150,7 +3150,7 @@ unionread: fdrop(fp, td); return (error); } - if (uap->count == auio.uio_resid) { + if (SCARG(uap, count) == auio.uio_resid) { if (union_dircheckp) { error = union_dircheckp(td, &vp, fp); if (error == -1) @@ -3177,9 +3177,9 @@ unionread: } VOP_UNLOCK(vp, 0, td); } - error = copyout(&loff, uap->basep, sizeof(long)); + error = copyout(&loff, SCARG(uap, basep), sizeof(long)); fdrop(fp, td); - td->td_retval[0] = uap->count - auio.uio_resid; + td->td_retval[0] = SCARG(uap, count) - auio.uio_resid; return (error); } #endif /* COMPAT_43 */ @@ -3212,7 +3212,7 @@ getdirentries(td, uap) long loff; int error, eofflag; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -3224,14 +3224,14 @@ unionread: fdrop(fp, td); return (EINVAL); } - aiov.iov_base = uap->buf; - aiov.iov_len = uap->count; + aiov.iov_base = SCARG(uap, buf); + aiov.iov_len = SCARG(uap, count); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap->count; + auio.uio_resid = SCARG(uap, count); /* vn_lock(vp, LK_SHARED | LK_RETRY, td); */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); loff = auio.uio_offset = fp->f_offset; @@ -3247,7 +3247,7 @@ unionread: fdrop(fp, td); return (error); } - if (uap->count == auio.uio_resid) { + if (SCARG(uap, count) == auio.uio_resid) { if (union_dircheckp) { error = union_dircheckp(td, &vp, fp); if (error == -1) @@ -3274,10 +3274,10 @@ unionread: } VOP_UNLOCK(vp, 0, td); } - if (uap->basep != NULL) { - error = copyout(&loff, uap->basep, sizeof(long)); + if (SCARG(uap, basep) != NULL) { + error = copyout(&loff, SCARG(uap, basep), sizeof(long)); } - td->td_retval[0] = uap->count - auio.uio_resid; + td->td_retval[0] = SCARG(uap, count) - auio.uio_resid; fdrop(fp, td); return (error); } @@ -3327,7 +3327,7 @@ umask(td, uap) FILEDESC_LOCK(td->td_proc->p_fd); fdp = td->td_proc->p_fd; td->td_retval[0] = fdp->fd_cmask; - fdp->fd_cmask = uap->newmask & ALLPERMS; + fdp->fd_cmask = SCARG(uap, newmask) & ALLPERMS; FILEDESC_UNLOCK(td->td_proc->p_fd); return (0); } @@ -3355,7 +3355,7 @@ revoke(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); @@ -3508,11 +3508,11 @@ fhopen(td, uap) if (error) return (error); - fmode = FFLAGS(uap->flags); + fmode = FFLAGS(SCARG(uap, flags)); /* why not allow a non-read/write open for our lockd? */ if (((fmode & (FREAD | FWRITE)) == 0) || (fmode & O_CREAT)) return (EINVAL); - error = copyin(uap->u_fhp, &fhp, sizeof(fhp)); + error = copyin(SCARG(uap,u_fhp), &fhp, sizeof(fhp)); if (error) return(error); /* find the mount point */ @@ -3703,7 +3703,7 @@ fhstat(td, uap) if (error) return (error); - error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); + error = copyin(SCARG(uap, u_fhp), &fh, sizeof(fhandle_t)); if (error) return (error); @@ -3715,7 +3715,7 @@ fhstat(td, uap) vput(vp); if (error) return (error); - error = copyout(&sb, uap->sb, sizeof(sb)); + error = copyout(&sb, SCARG(uap, sb), sizeof(sb)); return (error); } @@ -3750,7 +3750,7 @@ fhstatfs(td, uap) if (error) return (error); - if ((error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t))) != 0) + if ((error = copyin(SCARG(uap, u_fhp), &fh, sizeof(fhandle_t))) != 0) return (error); if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL) @@ -3773,7 +3773,7 @@ fhstatfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index a98e1a4..58e8434 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -323,7 +323,7 @@ nmount(td, uap) int error; u_int iovlen, iovcnt; - iovcnt = uap->iovcnt; + iovcnt = SCARG(uap, iovcnt); iovlen = iovcnt * sizeof (struct iovec); /* * Check that we have an even number of iovec's @@ -352,7 +352,7 @@ nmount(td, uap) } iov++; } - error = vfs_nmount(td, uap->flags, &auio); + error = vfs_nmount(td, SCARG(uap, flags), &auio); finish: if (needfree != NULL) free(needfree, M_TEMP); @@ -811,12 +811,12 @@ mount(td, uap) * vfs_mount() actually takes a kernel string for `type' and * `path' now, so extract them. */ - error = copyinstr(uap->type, fstype, MFSNAMELEN, NULL); + error = copyinstr(SCARG(uap, type), fstype, MFSNAMELEN, NULL); if (error == 0) - error = copyinstr(uap->path, fspath, MNAMELEN, NULL); + error = copyinstr(SCARG(uap, path), fspath, MNAMELEN, NULL); if (error == 0) - error = vfs_mount(td, fstype, fspath, uap->flags, - uap->data); + error = vfs_mount(td, fstype, fspath, SCARG(uap, flags), + SCARG(uap, data)); free(fstype, M_TEMP); free(fspath, M_TEMP); return (error); @@ -1199,7 +1199,7 @@ unmount(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1234,7 +1234,7 @@ unmount(td, uap) return (EINVAL); } vput(vp); - return (dounmount(mp, uap->flags, td)); + return (dounmount(mp, SCARG(uap, flags), td)); } /* diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 012cc91..8e2d605 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -191,7 +191,7 @@ quotactl(td, uap) if (jailed(td->td_ucred) && !prison_quotas) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -199,8 +199,8 @@ quotactl(td, uap) vrele(nd.ni_vp); if (error) return (error); - error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, - uap->arg, td); + error = VFS_QUOTACTL(mp, SCARG(uap, cmd), SCARG(uap, uid), + SCARG(uap, arg), td); vn_finished_write(mp); return (error); } @@ -229,7 +229,7 @@ statfs(td, uap) struct nameidata nd; struct statfs sb; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); mp = nd.ni_vp->v_mount; @@ -250,7 +250,7 @@ statfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* @@ -277,7 +277,7 @@ fstatfs(td, uap) int error; struct statfs sb; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); mp = ((struct vnode *)fp->f_data)->v_mount; fdrop(fp, td); @@ -298,7 +298,7 @@ fstatfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* @@ -325,8 +325,8 @@ getfsstat(td, uap) caddr_t sfsp; long count, maxcount, error; - maxcount = uap->bufsize / sizeof(struct statfs); - sfsp = (caddr_t)uap->buf; + maxcount = SCARG(uap, bufsize) / sizeof(struct statfs); + sfsp = (caddr_t)SCARG(uap, buf); count = 0; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -347,8 +347,8 @@ getfsstat(td, uap) * refresh the fsstat cache. MNT_NOWAIT or MNT_LAZY * overrides MNT_WAIT. */ - if (((uap->flags & (MNT_LAZY|MNT_NOWAIT)) == 0 || - (uap->flags & MNT_WAIT)) && + if (((SCARG(uap, flags) & (MNT_LAZY|MNT_NOWAIT)) == 0 || + (SCARG(uap, flags) & MNT_WAIT)) && (error = VFS_STATFS(mp, sp, td))) { mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); @@ -398,7 +398,7 @@ fchdir(td, uap) struct file *fp; int error; - if ((error = getvnode(fdp, uap->fd, &fp)) != 0) + if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; VREF(vp); @@ -539,7 +539,7 @@ chroot(td, uap) if (error) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); mtx_lock(&Giant); if ((error = change_dir(&nd, td)) != 0) goto error; @@ -809,9 +809,9 @@ ocreat(td, uap) syscallarg(int) mode; } */ nuap; - nuap.path = uap->path; - nuap.mode = uap->mode; - nuap.flags = O_WRONLY | O_CREAT | O_TRUNC; + SCARG(&nuap, path) = SCARG(uap, path); + SCARG(&nuap, mode) = SCARG(uap, mode); + SCARG(&nuap, flags) = O_WRONLY | O_CREAT | O_TRUNC; return (open(td, &nuap)); } #endif /* COMPAT_43 */ @@ -1176,7 +1176,7 @@ undelete(td, uap) restart: bwillwrite(); NDINIT(&nd, DELETE, LOCKPARENT|DOWHITEOUT, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); error = namei(&nd); if (error) return (error); @@ -1222,7 +1222,7 @@ unlink(td, uap) } */ *uap; { - return (kern_unlink(td, uap->path, UIO_USERSPACE)); + return (kern_unlink(td, SCARG(uap, path), UIO_USERSPACE)); } int @@ -1323,8 +1323,8 @@ lseek(td, uap) } vp = (struct vnode *)fp->f_data; noneg = (vp->v_type != VCHR); - offset = uap->offset; - switch (uap->whence) { + offset = SCARG(uap, offset); + switch (SCARG(uap, whence)) { case L_INCR: if (noneg && (fp->f_offset < 0 || @@ -1386,9 +1386,9 @@ olseek(td, uap) } */ nuap; int error; - nuap.fd = uap->fd; - nuap.offset = uap->offset; - nuap.whence = uap->whence; + SCARG(&nuap, fd) = SCARG(uap, fd); + SCARG(&nuap, offset) = SCARG(uap, offset); + SCARG(&nuap, whence) = SCARG(uap, whence); error = lseek(td, &nuap); return (error); } @@ -1506,12 +1506,12 @@ eaccess(td, uap) int error; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; - error = vn_access(vp, uap->flags, td->td_ucred, td); + error = vn_access(vp, SCARG(uap, flags), td->td_ucred, td); NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); return (error); @@ -1542,7 +1542,7 @@ ostat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1551,7 +1551,7 @@ ostat(td, uap) if (error) return (error); cvtstat(&sb, &osb); - error = copyout(&osb, uap->ub, sizeof (osb)); + error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); } @@ -1580,7 +1580,7 @@ olstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1590,7 +1590,7 @@ olstat(td, uap) if (error) return (error); cvtstat(&sb, &osb); - error = copyout(&osb, uap->ub, sizeof (osb)); + error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); } @@ -1648,10 +1648,10 @@ stat(td, uap) #ifdef LOOKUP_SHARED NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | NOOBJ, - UIO_USERSPACE, uap->path, td); + UIO_USERSPACE, SCARG(uap, path), td); #else NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); #endif if ((error = namei(&nd)) != 0) return (error); @@ -1660,7 +1660,7 @@ stat(td, uap) vput(nd.ni_vp); if (error) return (error); - error = copyout(&sb, uap->ub, sizeof (sb)); + error = copyout(&sb, SCARG(uap, ub), sizeof (sb)); return (error); } @@ -1688,7 +1688,7 @@ lstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1697,7 +1697,7 @@ lstat(td, uap) vput(vp); if (error) return (error); - error = copyout(&sb, uap->ub, sizeof (sb)); + error = copyout(&sb, SCARG(uap, ub), sizeof (sb)); return (error); } @@ -1753,7 +1753,7 @@ nstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1762,7 +1762,7 @@ nstat(td, uap) if (error) return (error); cvtnstat(&sb, &nsb); - error = copyout(&nsb, uap->ub, sizeof (nsb)); + error = copyout(&nsb, SCARG(uap, ub), sizeof (nsb)); return (error); } @@ -1791,7 +1791,7 @@ nlstat(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1801,7 +1801,7 @@ nlstat(td, uap) if (error) return (error); cvtnstat(&sb, &nsb); - error = copyout(&nsb, uap->ub, sizeof (nsb)); + error = copyout(&nsb, SCARG(uap, ub), sizeof (nsb)); return (error); } @@ -1827,7 +1827,7 @@ pathconf(td, uap) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, - uap->path, td); + SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1972,11 +1972,11 @@ chflags(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfflags(td, nd.ni_vp, uap->flags); + error = setfflags(td, nd.ni_vp, SCARG(uap, flags)); vrele(nd.ni_vp); return error; } @@ -1995,11 +1995,11 @@ lchflags(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfflags(td, nd.ni_vp, uap->flags); + error = setfflags(td, nd.ni_vp, SCARG(uap, flags)); vrele(nd.ni_vp); return error; } @@ -2025,9 +2025,9 @@ fchflags(td, uap) struct file *fp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); - error = setfflags(td, (struct vnode *) fp->f_data, uap->flags); + error = setfflags(td, (struct vnode *) fp->f_data, SCARG(uap, flags)); fdrop(fp, td); return (error); } @@ -2119,11 +2119,11 @@ lchmod(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = setfmode(td, nd.ni_vp, uap->mode); + error = setfmode(td, nd.ni_vp, SCARG(uap, mode)); vrele(nd.ni_vp); return error; } @@ -2150,10 +2150,10 @@ fchmod(td, uap) struct vnode *vp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; - error = setfmode(td, (struct vnode *)fp->f_data, uap->mode); + error = setfmode(td, (struct vnode *)fp->f_data, SCARG(uap, mode)); fdrop(fp, td); return (error); } @@ -2294,11 +2294,11 @@ fchown(td, uap) struct vnode *vp; int error; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; error = setfown(td, (struct vnode *)fp->f_data, - uap->uid, uap->gid); + SCARG(uap, uid), SCARG(uap, gid)); fdrop(fp, td); return (error); } @@ -2592,7 +2592,7 @@ ftruncate(td, uap) if (uap->length < 0) return(EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FWRITE) == 0) { fdrop(fp, td); @@ -2614,7 +2614,7 @@ ftruncate(td, uap) #endif else if ((error = vn_writechk(vp)) == 0) { VATTR_NULL(&vattr); - vattr.va_size = uap->length; + vattr.va_size = SCARG(uap, length); error = VOP_SETATTR(vp, &vattr, fp->f_cred, td); } VOP_UNLOCK(vp, 0, td); @@ -2648,8 +2648,8 @@ otruncate(td, uap) syscallarg(off_t) length; } */ nuap; - nuap.path = uap->path; - nuap.length = uap->length; + SCARG(&nuap, path) = SCARG(uap, path); + SCARG(&nuap, length) = SCARG(uap, length); return (truncate(td, &nuap)); } @@ -2677,8 +2677,8 @@ oftruncate(td, uap) syscallarg(off_t) length; } */ nuap; - nuap.fd = uap->fd; - nuap.length = uap->length; + SCARG(&nuap, fd) = SCARG(uap, fd); + SCARG(&nuap, length) = SCARG(uap, length); return (ftruncate(td, &nuap)); } #endif /* COMPAT_43 || COMPAT_SUNOS */ @@ -2707,7 +2707,7 @@ fsync(td, uap) GIANT_REQUIRED; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); vp = (struct vnode *)fp->f_data; if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { @@ -3062,9 +3062,9 @@ ogetdirentries(td, uap) long loff; /* XXX arbitrary sanity limit on `count'. */ - if (uap->count > 64 * 1024) + if (SCARG(uap, count) > 64 * 1024) return (EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -3076,14 +3076,14 @@ unionread: fdrop(fp, td); return (EINVAL); } - aiov.iov_base = uap->buf; - aiov.iov_len = uap->count; + aiov.iov_base = SCARG(uap, buf); + aiov.iov_len = SCARG(uap, count); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap->count; + auio.uio_resid = SCARG(uap, count); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); loff = auio.uio_offset = fp->f_offset; #ifdef MAC @@ -3105,14 +3105,14 @@ unionread: kuio = auio; kuio.uio_iov = &kiov; kuio.uio_segflg = UIO_SYSSPACE; - kiov.iov_len = uap->count; - MALLOC(dirbuf, caddr_t, uap->count, M_TEMP, M_WAITOK); + kiov.iov_len = SCARG(uap, count); + MALLOC(dirbuf, caddr_t, SCARG(uap, count), M_TEMP, M_WAITOK); kiov.iov_base = dirbuf; error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag, NULL, NULL); fp->f_offset = kuio.uio_offset; if (error == 0) { - readcnt = uap->count - kuio.uio_resid; + readcnt = SCARG(uap, count) - kuio.uio_resid; edp = (struct dirent *)&dirbuf[readcnt]; for (dp = (struct dirent *)dirbuf; dp < edp; ) { # if (BYTE_ORDER == LITTLE_ENDIAN) @@ -3150,7 +3150,7 @@ unionread: fdrop(fp, td); return (error); } - if (uap->count == auio.uio_resid) { + if (SCARG(uap, count) == auio.uio_resid) { if (union_dircheckp) { error = union_dircheckp(td, &vp, fp); if (error == -1) @@ -3177,9 +3177,9 @@ unionread: } VOP_UNLOCK(vp, 0, td); } - error = copyout(&loff, uap->basep, sizeof(long)); + error = copyout(&loff, SCARG(uap, basep), sizeof(long)); fdrop(fp, td); - td->td_retval[0] = uap->count - auio.uio_resid; + td->td_retval[0] = SCARG(uap, count) - auio.uio_resid; return (error); } #endif /* COMPAT_43 */ @@ -3212,7 +3212,7 @@ getdirentries(td, uap) long loff; int error, eofflag; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -3224,14 +3224,14 @@ unionread: fdrop(fp, td); return (EINVAL); } - aiov.iov_base = uap->buf; - aiov.iov_len = uap->count; + aiov.iov_base = SCARG(uap, buf); + aiov.iov_len = SCARG(uap, count); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap->count; + auio.uio_resid = SCARG(uap, count); /* vn_lock(vp, LK_SHARED | LK_RETRY, td); */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); loff = auio.uio_offset = fp->f_offset; @@ -3247,7 +3247,7 @@ unionread: fdrop(fp, td); return (error); } - if (uap->count == auio.uio_resid) { + if (SCARG(uap, count) == auio.uio_resid) { if (union_dircheckp) { error = union_dircheckp(td, &vp, fp); if (error == -1) @@ -3274,10 +3274,10 @@ unionread: } VOP_UNLOCK(vp, 0, td); } - if (uap->basep != NULL) { - error = copyout(&loff, uap->basep, sizeof(long)); + if (SCARG(uap, basep) != NULL) { + error = copyout(&loff, SCARG(uap, basep), sizeof(long)); } - td->td_retval[0] = uap->count - auio.uio_resid; + td->td_retval[0] = SCARG(uap, count) - auio.uio_resid; fdrop(fp, td); return (error); } @@ -3327,7 +3327,7 @@ umask(td, uap) FILEDESC_LOCK(td->td_proc->p_fd); fdp = td->td_proc->p_fd; td->td_retval[0] = fdp->fd_cmask; - fdp->fd_cmask = uap->newmask & ALLPERMS; + fdp->fd_cmask = SCARG(uap, newmask) & ALLPERMS; FILEDESC_UNLOCK(td->td_proc->p_fd); return (0); } @@ -3355,7 +3355,7 @@ revoke(td, uap) int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), td); if ((error = namei(&nd)) != 0) return (error); @@ -3508,11 +3508,11 @@ fhopen(td, uap) if (error) return (error); - fmode = FFLAGS(uap->flags); + fmode = FFLAGS(SCARG(uap, flags)); /* why not allow a non-read/write open for our lockd? */ if (((fmode & (FREAD | FWRITE)) == 0) || (fmode & O_CREAT)) return (EINVAL); - error = copyin(uap->u_fhp, &fhp, sizeof(fhp)); + error = copyin(SCARG(uap,u_fhp), &fhp, sizeof(fhp)); if (error) return(error); /* find the mount point */ @@ -3703,7 +3703,7 @@ fhstat(td, uap) if (error) return (error); - error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); + error = copyin(SCARG(uap, u_fhp), &fh, sizeof(fhandle_t)); if (error) return (error); @@ -3715,7 +3715,7 @@ fhstat(td, uap) vput(vp); if (error) return (error); - error = copyout(&sb, uap->sb, sizeof(sb)); + error = copyout(&sb, SCARG(uap, sb), sizeof(sb)); return (error); } @@ -3750,7 +3750,7 @@ fhstatfs(td, uap) if (error) return (error); - if ((error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t))) != 0) + if ((error = copyin(SCARG(uap, u_fhp), &fh, sizeof(fhandle_t))) != 0) return (error); if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL) @@ -3773,7 +3773,7 @@ fhstatfs(td, uap) sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; sp = &sb; } - return (copyout(sp, uap->buf, sizeof(*sp))); + return (copyout(sp, SCARG(uap, buf), sizeof(*sp))); } /* |