HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
r
rtprio(2) rtprio(2)
RETURN VALUE
rtprio() returns the following values:
0 to 127 The process was a real-time process. The value is the process’s former (before
the call) real-time priority.
RTPRIO_RTOFF The process was not a real-time process.
-1 An error occurred. errno is set to indicate the error.
ERRORS
If rtprio() fails, errno is set to one of the following values:
[EACCES] The target process could not be accessed due to compartmental restrictions.
[EINVAL] prio is not
RTPRIO_NOCHG , RTPRIO_RTOFF , or in the range 0 to 127.
[EPERM] The calling process is not a user having appropriate privileges, and neither its real nor
effective user ID match the real or saved user ID of the process indicated by pid.
[EPERM] The group access list of the calling process does not contain a group having
PRIV_RTPRIO capability and prio is not RTPRIO_NOCHG ,orRTPRIO_RTOFF
with a pid of zero.
[ESRCH] No process can be found corresponding to that specified by pid.
EXAMPLES
The following call to
rtprio() sets the calling process to a real-time priority of 90:
rtprio(0, 90);
WARNINGS
Normally, compute-bound programs should not be run at real-time priorities, because all timesharing work
on the CPU would come to a complete halt.
DEPENDENCIES
Because processes executing at real-time priorities get scheduling preference over a system process execut-
ing at a lower priority, unexpected system behavior can occur after a power failure on systems that support
power-fail recovery. For example, when init (see init(1M)) receives the powerfail signal SIGPWR, it nor-
mally reloads programmable hardware such as terminal multiplexers. If a higher-priority real-time process
is eligible to run after the power failure, the running of
init is delayed. This condition temporarily
prevents terminal input to any process, including real-time shells of higher priority than the eligible real-
time process. To avoid this situation, a real-time process should catch SIGPWR and suspend itself until
init has finished its powerfail processing.
AUTHOR
rtprio() was developed by HP.
SEE ALSO
rtprio(1), getprivgrp(2), nice(2), plock(2), privileges(5).
HP-UX 11i Version 3: February 2007 − 2 − Hewlett-Packard Company 345