NAME

     getpriority, setpriority - get and set scheduling priority


SYNOPSIS

     #include <sys/resource.h>

     int getpriority(int which, int who)
     int setpriority(int which, int who, int prio)


DESCRIPTION

     Getpriority returns the scheduling priority of the  process,
     process  group,  or  user  referred  to in who. Which of the
     three is indicated in which, by PRIO_PROCESS, PRIO_PGRP  and
     PRIO_USER,   respectively.    In  MINIX  3,  currently  only
     PRIO_PROCESS is implemented.

     The range of the returned  value  is  between  PRIO_MIN  and
     PRIO_MAX, currently between -20 and 20, and is the so-called
     nice value of a process. The higher the nice value, the less
     favourable the scheduling priority.

     Setpriority sets the priority indicated by who and which  to
     prio.  prio, which is the nice value, may only be lowered by
     the super-user.


RETURN VALUES

     These functions both return -1 on failure, and set errno  in
     this  case.   Because  getpriority can return -1 as the real
     nice value, the caller has to reset errno  and  check  errno
     afterwards  to  distinguish between an error condition and a
     negative nice value.


SEE ALSO

     nice(1)


AUTHOR

     Ben Gras <beng@few.vu.nl>