sched_setparam(2) DG/UX 5.4 Rel. 2.01 sched_setparam(2)
NAME
sched_setparam - set the scheduling priority for a process
SYNOPSIS
#include <sched.h>
int schedsetparam (pid, *priority)
pidt pid;
struct schedparam*priority;
DESCRIPTION
Use schedsetparam(2) to set the scheduling priority of process pid
to the value indicated in priority. The POSIX-designated structure
that priority points to is:
struct schedparam
{
int schedpriority;
};
If pid is 0, this call sets the priority of the calling process.
The larger the number in schedpriority, the higher the priority. To
find out the priority range for a given pid, use
schedgetscheduler(2) to get its scheduling policy, then use
schedgetprioritymax(2) and schedgetprioritymin(2) to get the
range defined by that policy.
Only the superuser can set a priority higher than the current
priority. A priority that is lower than or equal to the current
priority may be set either by the superuser or by a process having an
effective user id matching that of pid.
If this call fails, the priority of pid is not changed.
Note
* This routine is based on POSIX realtime extension document P1003.4
draft 12. It is therefore subject to change.
* Compilation of a source file using this routine requires that
feature macro _POSIX4_DRAFT_SOURCE be defined. This feature macro
is not enabled by any other feature macro, nor does it enable any
other feature macro.
* The compiled routine must be linked to library librte.a.
RETURN VALUE
If successful, schedsetparam returns 0. If unsuccessful, the routine
returns -1 and sets ERRNO to one of the following:
EFAULT The address of priority is bad.
EINVAL The priority value in schedpriority is outside the range
defined for the scheduling policy of pid.
Licensed material--property of copyright holder(s) 1
sched_setparam(2) DG/UX 5.4 Rel. 2.01 sched_setparam(2)
EPERM The caller does not have permission to set the scheduling
priority of pid.
ESRCH Process pid doesn't exist or is negative.
SEE ALSO
schedgetparam(2), schedsetscheduler(2), schedgetscheduler(2),
schedyield(2), schedgetprioritymax(2), schedgetprioritymin(2),
schedrrgetinterval(2).
Licensed material--property of copyright holder(s) 2