nice(2) nice(2)
NAME
nice - change priority of a time-sharing process
SYNOPSIS
#include <unistd.h>
int nice(int incr);
DESCRIPTION
nice() allows a process in the time-sharing scheduling class to change
its priority. The priocntl() system call is a more general interface
to scheduler functions.
nice() adds the value of incr to the nice value of the calling pro-
cess. A process' nice value is a non-negative number for which a more
positive value results in lower CPU priority.
A maximum nice value is 39 and the minimum is 0 (the default value is
20). Calls using values above or below these limits result in the
highest value being used. Only a process with appropriate privileges
can lower the nice value.
ERRORS
The following error code descriptions are function-specific. You will
find a general description in introprm2(2) or in errno(5).
The nice() function will fail if:
EPERM nice() fails and does not change the nice value if incr is
negative or greater than 39 and the effective user ID of the
calling process is not superuser.
EINVAL nice() fails if called by a process in a scheduling class
other than time-sharing.
RESULT
Upon successful completion, nice() returns the new value minus 20.
Otherwise, a value of -1 is returned, the process' nice value is not
changed, and errno is set to indicate the error.
SEE ALSO
nice(1), exec(2), priocntl(2), unistd(4).
Page 1 Reliant UNIX 5.44 Printed 11/98