All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)getpriority.2 5.1 (Berkeley) 05/09/85
#include <sys/resource.h>#define PRIO_PROCESS 0 /* process */ #define PRIO_PGRP 1 /* process group */ #define PRIO_USER 2 /* user id */
prio = getpriority(which, who) int prio, which, who;
setpriority(which, who, prio) int which, who, prio;
The getpriority call returns the highest priority (lowest numerical value) enjoyed by any of the specified processes. The setpriority call sets the priorities of all of the specified processes to the specified value. Only the super-user may lower priorities.
15 [ESRCH] No process(es) were located using the which and who values specified.
15 [EINVAL] Which was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER.
In addition to the errors indicated above, setpriority may fail with one of the following errors returned:
15 [EACCES] A process was located, but neither its effective nor real user ID matched the effective user ID of the caller.
15 [EACCES] A non super-user attempted to change a process priority to a negative value.