(BSD System Compatibility)
getpriority, setpriority --
(BSD) get/set program scheduling priority
/usr/ucb/cc [flag . . . ] file . . .
int getpriority(int which, int who);
int setpriority(int which, int who, int prio);
priority of the process, process group, or user, as indicated by
is obtained with
and set with
The default priority is 0;
lower priorities cause more favorable scheduling.
is one of
is interpreted relative to
(a process identifier for
process group identifier for
and a user
A zero value of
denotes the current process, process group, or user.
returns the highest priority (lowest numerical value)
enjoyed by any of the specified processes.
sets the priorities of all of the specified processes
to the value specified by
is less than -20, a value of -20 is used;
if it is greater than 20, a value of 20 is used.
Only the privileged user may lower priorities.
can legitimately return the value -1, it is necessary
to clear the external variable
prior to the
call, then check it afterward to determine
if a -1 is an error or a legitimate value.
call returns 0 if there is no error, or
-1 if there is.
may return one of the following errors:
No process was located using the
was not one of
In addition to the errors indicated above,
may fail with the following error:
A process was located, but one of the following is true:
Neither its effective nor real user
matched the effective user
of the caller, and neither the effective
nor the real user
of the process executing the
was the privileged user.
The call to
would have changed a process' priority to a
value lower than its current value,
and the effective user
of the process executing the call was
not that of the privileged user.
It is not possible for the process executing
to lower any other process down to its current priority,
without requiring privileged user privileges.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004