summaryrefslogtreecommitdiffstats
path: root/sys/kern/p1003_1b.c
diff options
context:
space:
mode:
authordufault <dufault@FreeBSD.org>1998-05-19 21:11:53 +0000
committerdufault <dufault@FreeBSD.org>1998-05-19 21:11:53 +0000
commit9feb27237255a180d341b3412632902b6444e5db (patch)
tree06c73759b39ea07ecd0f30e9daad61d026283c8f /sys/kern/p1003_1b.c
parentc3a59be9e05f46a91db89ccc0c0e8f5d5502c8dc (diff)
downloadFreeBSD-src-9feb27237255a180d341b3412632902b6444e5db.zip
FreeBSD-src-9feb27237255a180d341b3412632902b6444e5db.tar.gz
1. Add new defs for mins and maxs for the POSIX flavor priorities. They
end up being the same, but it doesn't look like you're comparing apples and oranges. 2. Use need_resched instead of reset_priority. This isn't right either, since for example you'll round-robin against equal priority FIFO processes when lowering the priority of another process, but this works better and a real fix needs to be in kern_synch and not out here. 3. This is not a device driver: copyin/copyout the structure.
Diffstat (limited to 'sys/kern/p1003_1b.c')
-rw-r--r--sys/kern/p1003_1b.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c
index c23d6a1..62ce150 100644
--- a/sys/kern/p1003_1b.c
+++ b/sys/kern/p1003_1b.c
@@ -162,10 +162,13 @@ int sched_setparam(struct proc *p,
{
int e;
+ struct sched_param sched_param;
+ copyin(uap->param, &sched_param, sizeof(sched_param));
+
(void) (0
|| (e = p31b_proc(p, uap->pid, &p))
|| (e = ksched_setparam(&p->p_retval[0], ksched, p,
- (const struct sched_param *) &uap->param))
+ (const struct sched_param *)&sched_param))
);
return e;
@@ -175,22 +178,31 @@ int sched_getparam(struct proc *p,
struct sched_getparam_args *uap)
{
int e;
+ struct sched_param sched_param;
(void) (0
|| (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_getparam(&p->p_retval[0], ksched, p, uap->param))
+ || (e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param))
);
+ if (!e)
+ copyout(&sched_param, uap->param, sizeof(sched_param));
+
return e;
}
int sched_setscheduler(struct proc *p,
struct sched_setscheduler_args *uap)
{
int e;
+
+ struct sched_param sched_param;
+ copyin(uap->param, &sched_param, sizeof(sched_param));
+
(void) (0
|| (e = p31b_proc(p, uap->pid, &p))
|| (e = ksched_setscheduler(&p->p_retval[0],
- ksched, p, uap->policy, uap->param))
+ ksched, p, uap->policy,
+ (const struct sched_param *)&sched_param))
);
return e;
OpenPOWER on IntegriCloud