Bug 227735

Summary: sched_setscheduler returns EPERM instead of EINVAL when sched_priority is out of range
Product: Base System Reporter: Ali Abdallah <ali.abdallah>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People CC: 0mp, kpraveen.lkml
Priority: --- Keywords: easy, needs-qa
Version: 11.1-STABLE   
Hardware: Any   
OS: Any   

Description Ali Abdallah 2018-04-24 06:03:04 UTC
According to the documentation of sched_setscheduler, [EINVAL] should be returned if the value of the policy argument is invalid, or one or more parameters contained in param is outside the valid range.

In ksched.c line 180, the ksched_setscheduler functions returns EPERM when
the check (param->sched_priority >= P1B_PRIO_MIN && param->sched_priority <=
P1B_PRIO_MAX) fails, It should return EINVAL instead.

This is a minor issue, but I think it should be fixed.