summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-07-13 06:41:26 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-07-13 06:41:26 +0000
commit42ece42bed616b341daa85f1f7a48694000e4cea (patch)
tree87673071dd78ceef8869150a34f49ac6f1c6b215 /sys/kern
parent19b84189035f11be93ba57379660d66d24d77c2b (diff)
downloadFreeBSD-src-42ece42bed616b341daa85f1f7a48694000e4cea.zip
FreeBSD-src-42ece42bed616b341daa85f1f7a48694000e4cea.tar.gz
Backout the feature which can change thread's scheduling option, I really
don't want to mix process and thread scheduling options together in these functions, now the thread scheduling option is implemented in new thr syscalls.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/p1003_1b.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c
index 6d4d30a..189f593 100644
--- a/sys/kern/p1003_1b.c
+++ b/sys/kern/p1003_1b.c
@@ -126,19 +126,11 @@ sched_setparam(struct thread *td, struct sched_setparam_args *uap)
targetp = td->td_proc;
targettd = td;
PROC_LOCK(targetp);
- } else if (uap->pid <= PID_MAX) {
+ } else {
targetp = pfind(uap->pid);
if (targetp == NULL)
return (ESRCH);
targettd = FIRST_THREAD_IN_PROC(targetp);
- } else {
- targetp = td->td_proc;
- PROC_LOCK(targetp);
- targettd = thread_find(targetp, uap->pid);
- if (targetp == NULL) {
- PROC_UNLOCK(targetp);
- return (ESRCH);
- }
}
e = p_cansched(td, targetp);
@@ -165,20 +157,12 @@ sched_getparam(struct thread *td, struct sched_getparam_args *uap)
targetp = td->td_proc;
targettd = td;
PROC_LOCK(targetp);
- } else if (uap->pid <= PID_MAX) {
+ } else {
targetp = pfind(uap->pid);
if (targetp == NULL) {
return (ESRCH);
}
targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
- } else {
- targetp = td->td_proc;
- PROC_LOCK(targetp);
- targettd = thread_find(targetp, uap->pid);
- if (targettd == NULL) {
- PROC_UNLOCK(targetp);
- return (ESRCH);
- }
}
e = p_cansee(td, targetp);
@@ -214,19 +198,11 @@ sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap)
targetp = td->td_proc;
targettd = td;
PROC_LOCK(targetp);
- } else if (uap->pid <= PID_MAX) {
+ } else {
targetp = pfind(uap->pid);
if (targetp == NULL)
return (ESRCH);
targettd = FIRST_THREAD_IN_PROC(targetp);
- } else {
- targetp = td->td_proc;
- PROC_LOCK(targetp);
- targettd = thread_find(targetp, uap->pid);
- if (targettd == NULL) {
- PROC_UNLOCK(targetp);
- return (ESRCH);
- }
}
e = p_cansched(td, targetp);
@@ -252,22 +228,13 @@ sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
targetp = td->td_proc;
targettd = td;
PROC_LOCK(targetp);
- } else if (uap->pid <= PID_MAX) {
+ } else {
targetp = pfind(uap->pid);
if (targetp == NULL) {
e = ESRCH;
goto done2;
}
targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
- } else {
- targetp = td->td_proc;
- PROC_LOCK(targetp);
- targettd = thread_find(targetp, uap->pid);
- if (targettd == NULL) {
- PROC_UNLOCK(targetp);
- e = ESRCH;
- goto done2;
- }
}
e = p_cansee(td, targetp);
@@ -347,11 +314,6 @@ kern_sched_rr_get_interval(struct thread *td, pid_t pid,
targettd = td;
targetp = td->td_proc;
PROC_LOCK(targetp);
- } else if (pid <= PID_MAX) {
- targetp = pfind(pid);
- if (targetp == NULL)
- return (ESRCH);
- targettd = FIRST_THREAD_IN_PROC(targetp);
} else {
targetp = td->td_proc;
PROC_LOCK(targetp);
OpenPOWER on IntegriCloud