nice() - change a process' nice value
#include <unistd.h>
int nice (int incr)
The nice(3) call adds the value of incr to the calling process' nice value.
The nice value determines the priority of a process in scheduling. The higher the nice value, the lower the priority. The maximum nice value on the system is 2 * {NZERO}-1, and the minimum nice value is zero. ({NZERO} is the default process priority.)
On success, the nice(3) call returns the new nice value of the process minus the default process priority. If it failed, it returns -1 and sets errno.
Note that -1 is a legitimate return value on success if the process is allowed to lower its nice value. To check for an error, the application should set errno to zero, then call nice(3), and if it returns -1, check errno to see if it is non-zero.
The nice(3) call can fail for the following reasons:
To increase the priority of a process, the calling process must have the Windows privilege SE_INC_BASE_PRIORITY_NAME, also called SeIncreaseBasePriorityPrivilege.
nice(1)
renice(1)