sched_setparam sets the scheduling parameters associated with the
scheduling policy for the process identified by pid. If pid is
zero, then the parameters of the current process are set. The interpretation
of the parameter p depends on the selected policy. Currently, the
following three scheduling policies are supported under Linux:
SCHED_FIFO, SCHED_RR, and SCHED_OTHER.
sched_getparam retrieves the scheduling parameters for the process
identified by pid. If pid is zero, then the parameters of the
current process are retrieved.
sched_setparam checks the validity of p for the scheduling policy
of the process. The parameter p->sched_priority must lie within the
range given by sched_get_priority_min and
POSIX systems on which sched_setparam and sched_getparam are
available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
The parameter p does not make sense for the current
The calling process does not have appropriate privileges. A
process calling sched_setparam needs an effective user ID equal to
the user ID or effective user ID of the process identified by pid,
or (Linux) it must have the CAP_SYS_NICE capability.