Skip to content

Commit

Permalink
[PATCH] fix sched_setscheduler semantics
Browse files Browse the repository at this point in the history
Currently, a negative policy argument passed into the
'sys_sched_setscheduler()' system call, will return with success.  However,
the manpage for 'sys_sched_setscheduler' says:

EINVAL The scheduling policy is not one of the recognized policies, or the
              parameter p does not make sense for the policy.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jason Baron authored and Linus Torvalds committed Jan 19, 2006
1 parent 147b31c commit c21761f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3850,6 +3850,10 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
struct sched_param __user *param)
{
/* negative values for policy are not valid */
if (policy < 0)
return -EINVAL;

return do_sched_setscheduler(pid, policy, param);
}

Expand Down

0 comments on commit c21761f

Please sign in to comment.