HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
r
rtsched(2) rtsched(2)
member in the param structure is any integer within the inclusive priority range for the current scheduling
policy of the process specified by pid.
Higher numerical values for the priority represent higher (stronger) priorities. Note that this is different
from the SCHED_HPUX , SCHED_TIMESHARE, SCHED_NOAGE , and SCHED_RTPRIO scheduling poli-
cies, where higher numerical values represent lower (weaker) priorities. See the
PRI_HPUX_TO_POSIX() and PRI_POSIX_TO_HPUX() functions, and SCHED_RTPRIO ,
SCHED_NOAGE , and SCHED_OTHER in "Scheduling Policies" below.
If a process described by pid exists and if the calling process has permission, the scheduling parameters are
set for the process whose process ID is equal to pid.
If pid is zero, the scheduling parameters are set for the calling process.
If the process pid contains more than one thread or lightweight process (that is, the process is multi-
threaded), this function shall only change the process scheduling policy and priority. Individual threads or
lightweight processes in the target process shall not have their scheduling policies and priorities modified.
Note that if the target process is multi-threaded, this process scheduling policy and priority change will
only affect a child process that is created later and inherits its parent’s scheduling policy and priority. The
priority returned is the old priority of the target process, though individual threads or lightweight processes
may have a different value if some other interface is used to change an individual thread or lightweight
processes priority.
Only a superuser may change the scheduling parameters of another process.
The calling process must have the appropriate privileges or be a member of a group having
PRIV_RTSCHED access to successfullycall sched_setparam()
.
The target process, whether it is running or not running, will resume execution after all other runnable
processes of equal or greater priority have been scheduled to run.
If the priority of the process specified by the pid argument is set higher than that of the lowest priority run-
ning process, and if the specified process is ready to run, the process specified by the pid argument will
preempt a lowest-priority running process. Similarly, if the process calling
sched_setparam() sets its
own priority lower than that of one or more other nonempty process lists, then the process that is the head
of the highest priority list will also preempt the calling process. Thus, in either case, the originating pro-
cess may not receive notification of the completion of the requested priority change until the higher priority
process has executed.
sched_getparam()
The
sched_getparam() function returns the scheduling parameters of a process specified by pid in the
sched_param structure pointed to by param.
If a process described by pid exists, the scheduling parameters are returned for the process whose process
ID is equal to pid.
If the process pid contains more than one thread or lightweight process (that is, the process is multi-
threaded), this function shall only return the process scheduling policy and priority. Individual threads or
lightweight processes in the target process will have their own scheduling policies and priorities which may
be different from the scheduling policy and priority of their process.
If pid is zero, the scheduling parameters are returned for the calling process.
sched_setscheduler()
The
sched_setscheduler()
function sets the scheduling policy and scheduling parameters of the pro-
cess specified by pid to policy and the parameters specified in the sched_param structure pointed to by
param, respectively. The value of the sched_priority member in the param structure can be any integer
within the inclusive priority range for the scheduling policy specified by policy.
The possible values for the policy parameter are defined in the header file
<sched.h>, and mentioned
below.
If a process described by pid exists, the scheduling policy and scheduling parameters are set for the process
whose process ID is equal to pid.
If pid is zero, the scheduling policy and scheduling parameters are set for the calling process.
If the process pid contains more than one thread or lightweight process (that is, the process is multi-
threaded), this function shall only change the process scheduling policy and priority. Individual threads or
lightweight processes in the target process shall not have their scheduling policies and priorities modified.
Section 2−−266 − 2 − HP-UX Release 11i: December 2000
___
___