getpriority(2) DG/UX 4.30 getpriority(2)
NAME
getpriority - Get process scheduling priority.
SYNOPSIS
#include <sys/resource.h>
int getpriority (which, who)
int which;
int who;
PARAMETERS
which Specifies how the argument <who> is to be
interpreted in identifying one or more
processes to get the priority for. It may
take on the value PRIO_PROCESS, PRIO_PGRP, or
PRIO_USER.
who Identifies one or more processes to get the
priority for; may be a process ID, a process
group ID, or user ID, depending on the value
of <which>.
DESCRIPTION
One or more processes are identified by the combination of
the arguments <which> and <who>. If <which> is
PRIO_PROCESS, <who> is interpreted as a process ID and a
single process identified. If <which> is PRIO_PGRP, <who>
is interpreted as a process group ID, and all processes that
are members of that group are identified. If <which> is
PRIO_USER, <who> is interpreted as a user ID, and all
processes with effective-user-id of <who> are identified. A
<who> value of 0 is interpreted as the calling process's
process ID, process group ID, and effective-user-id,
respectively, for the three cases listed. For example, all
processes in the calling process' process group may be
identified with <which> set to PRIO_PGRP and <who> set to
zero.
The getpriority call returns the highest priority (lowest
numerical value) enjoyed by any of the identified processes.
ACCESS CONTROL
No access checking is performed.
RETURN VALUE
If no errors occur, getpriority returns the highest priority
(lowest numerical value) enjoyed by any of the identified
processes. If an error occurs, -1 is returned and errno is
set to identify the error.
Since getpriority can legitimately return the value -1, it
Licensed material--property of copyright holder(s) Page 1
getpriority(2) DG/UX 4.30 getpriority(2)
is necessary to clear the external variable errno prior to
the call, then check it afterward to determine if a -1 is an
error or a legitimate value.
EXCEPTIONS
Errno may be set to one of the following error codes:
ESRCH No process(es) were located using the <which>
and <who> values specified.
EINVAL <Which> was not one of PRIO_PROCESS,
PRIO_PGRP, or PRIO_USER.
SEE ALSO
The related system call: nice, fork.
Licensed material--property of copyright holder(s) Page 2