nice(2)
NAME
nice − change nice value of a process
SYNOPSIS
int nice (incr)
int incr;
DESCRIPTION
nice adds the value of incr to the nice value of the calling process. A process’s nice value is a positive number for which a more positive value results in less favorable CPU priority.
A maximum nice value of 19 and a minimum nice value of -20 are imposed by the system. Requests for values above or below these limits result in the nice value being set to the corresponding limit. Lower nice values cause more favorable scheduling. The internal scheduling priority for a process is a function of the specified nice value.
When the INTERACTIVE_CLASS option is configured in the system, a process whose nice value is between -20 and -16 has a static priority, that is; it does not have its internal scheduling priority altered by the system. A process whose nice value is greater than -16 may have its internal scheduling priority altered by the system.
When the INTERACTIVE_CLASS option is not configured, the internal scheduling priority of a process is never altered. See the CX/RT Reference Manual for more information about scheduling.
Modifying the nice value of a process results in the process’s time quantum (see setquantum(2)) being reset to the system default value corresponding to the new priority value.
[EPERM] nice will fail and not change the nice value if incr is negative or greater than 39 and the effective user ID of the calling process is not that of the super-user or the user does not have the ACC_SETPRI access vector. (If access vectors are configured)
RETURN VALUE
Upon successful completion, nice returns the new nice value. Otherwise, a value of −1 is returned and errno is set to indicate the error.
SEE ALSO
nice(1), exec(2), setquantum(2)
CX/UX Programmer’s Reference Manual