diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-06-30 03:13:36 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-06-30 03:13:36 +0000 |
commit | c35de5d85da7f89dd1044ece0fcd061be4bde9b6 (patch) | |
tree | 4bb7fd7c5324ac143ebcc06e4985a10c4704d135 | |
parent | dcedf89d63b0d96d2353f93d54c6fd039ce6bc54 (diff) | |
download | FreeBSD-src-c35de5d85da7f89dd1044ece0fcd061be4bde9b6.zip FreeBSD-src-c35de5d85da7f89dd1044ece0fcd061be4bde9b6.tar.gz |
Replace some use of 'p' with 'targetp' so as to not scarily overload the
passed 'p' argument. No functional change.
Obtained from: USENIX Emporium, Cheap Tricks Department
-rw-r--r-- | sys/kern/p1003_1b.c | 28 | ||||
-rw-r--r-- | sys/posix4/p1003_1b.c | 28 |
2 files changed, 34 insertions, 22 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index b0d8bc5..4f7d339 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -166,6 +166,7 @@ static int sched_attach(void) int sched_setparam(struct proc *p, struct sched_setparam_args *uap) { + struct proc *targetp; int e; struct sched_param sched_param; @@ -173,10 +174,10 @@ int sched_setparam(struct proc *p, if (e) return (e); - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_setparam(&p->p_retval[0], ksched, p, + e = ksched_setparam(&p->p_retval[0], ksched, targetp, (const struct sched_param *)&sched_param); return (e); } @@ -186,11 +187,12 @@ int sched_getparam(struct proc *p, { int e; struct sched_param sched_param; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param); + e = ksched_getparam(&p->p_retval[0], ksched, targetp, &sched_param); if (e) return (e); @@ -201,16 +203,17 @@ int sched_setscheduler(struct proc *p, struct sched_setscheduler_args *uap) { int e; - struct sched_param sched_param; + struct proc *targetp; + e = copyin(uap->param, &sched_param, sizeof(sched_param)); if (e) return (e); - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_setscheduler(&p->p_retval[0], ksched, p, uap->policy, + e = ksched_setscheduler(&p->p_retval[0], ksched, targetp, uap->policy, (const struct sched_param *)&sched_param); return (e); @@ -219,11 +222,12 @@ int sched_getscheduler(struct proc *p, struct sched_getscheduler_args *uap) { int e; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_getscheduler(&p->p_retval[0], ksched, p); + e = ksched_getscheduler(&p->p_retval[0], ksched, targetp); return (e); } @@ -248,11 +252,13 @@ int sched_rr_get_interval(struct proc *p, struct sched_rr_get_interval_args *uap) { int e; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_rr_get_interval(&p->p_retval[0], ksched, p, uap->interval); + e = ksched_rr_get_interval(&p->p_retval[0], ksched, targetp, + uap->interval); return (e); } diff --git a/sys/posix4/p1003_1b.c b/sys/posix4/p1003_1b.c index b0d8bc5..4f7d339 100644 --- a/sys/posix4/p1003_1b.c +++ b/sys/posix4/p1003_1b.c @@ -166,6 +166,7 @@ static int sched_attach(void) int sched_setparam(struct proc *p, struct sched_setparam_args *uap) { + struct proc *targetp; int e; struct sched_param sched_param; @@ -173,10 +174,10 @@ int sched_setparam(struct proc *p, if (e) return (e); - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_setparam(&p->p_retval[0], ksched, p, + e = ksched_setparam(&p->p_retval[0], ksched, targetp, (const struct sched_param *)&sched_param); return (e); } @@ -186,11 +187,12 @@ int sched_getparam(struct proc *p, { int e; struct sched_param sched_param; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param); + e = ksched_getparam(&p->p_retval[0], ksched, targetp, &sched_param); if (e) return (e); @@ -201,16 +203,17 @@ int sched_setscheduler(struct proc *p, struct sched_setscheduler_args *uap) { int e; - struct sched_param sched_param; + struct proc *targetp; + e = copyin(uap->param, &sched_param, sizeof(sched_param)); if (e) return (e); - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_setscheduler(&p->p_retval[0], ksched, p, uap->policy, + e = ksched_setscheduler(&p->p_retval[0], ksched, targetp, uap->policy, (const struct sched_param *)&sched_param); return (e); @@ -219,11 +222,12 @@ int sched_getscheduler(struct proc *p, struct sched_getscheduler_args *uap) { int e; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_getscheduler(&p->p_retval[0], ksched, p); + e = ksched_getscheduler(&p->p_retval[0], ksched, targetp); return (e); } @@ -248,11 +252,13 @@ int sched_rr_get_interval(struct proc *p, struct sched_rr_get_interval_args *uap) { int e; + struct proc *targetp; - e = p31b_proc(p, uap->pid, &p); + e = p31b_proc(p, uap->pid, &targetp); if (e) return (e); - e = ksched_rr_get_interval(&p->p_retval[0], ksched, p, uap->interval); + e = ksched_rr_get_interval(&p->p_retval[0], ksched, targetp, + uap->interval); return (e); } |