Bug 227735 - sched_setscheduler returns EPERM instead of EINVAL when sched_priority is out of range
Summary: sched_setscheduler returns EPERM instead of EINVAL when sched_priority is out...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2018-04-24 06:03 UTC by Ali Abdallah
Modified: 2018-06-11 09:21 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.