.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)getpriority.2 8.1 (Berkeley) %G%
.Nd get/set program scheduling priority
.Fd #include <sys/time.h>
.Fd #include <sys/resource.h>
.Fn getpriority "int which" "int who"
.Fn setpriority "int which" "int who" "int prio"
priority of the process, process group, or user, as indicated by
is interpreted relative to
(a process identifier for
denotes the current process, process group, or user.
is a value in the range -20 to 20. The default priority is 0;
lower priorities cause more favorable scheduling.
call returns the highest priority (lowest numerical value)
enjoyed by any of the specified processes. The
call sets the priorities of all of the specified processes
to the specified value. Only the super-user may lower priorities.
can legitimately return the value -1, it is necessary
to clear the external variable
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
No process was located using the
In addition to the errors indicated above,
A process was located, but neither its effective nor real user
ID matched the effective user ID of the caller.
A non super-user attempted to lower a process priority.
function call appeared in