nice — change priority of a process
int nice(int priority_change);
adds the value of
to the nice value of the calling process.
is a positive number for which a more positive value results in lower
A maximum nice value of 39 and a minimum nice value of 0
are imposed by the system.
Requests for values above or below these limits result in the nice value
being set to the corresponding limit.
If the calling process contains more than one thread or
lightweight process (i.e., the
process is multi-threaded) this function shall apply to all threads or
lightweight processes in the calling process.
Some or all of the actions associated with this system call are subject to
compartmental restrictions. See
for more information about compartmentalization on systems that support
Compartmental restrictions can be overridden if the process possesses the
Processes owned by the superuser may not have this privilege.
Processes owned by any user may have this privilege, depending on system
Some or all of the actions associated with this system call require the
(OWNER) and/or the
Processes owned by the superuser will have these privileges.
Processes owned by other users may have privilege(s), depending on system
for more information about privileged access on
systems that support fine-grained privileges.
Upon successful completion,
returns the new nice value minus 20.
Otherwise, a value of -1 is returned and
is set to indicate the error.
assumes a user process priority value of 20.
If a user
having appropriate privileges
has changed the user process priority value
to something less than 20, certain values for
to return -1, which is indistinguishable from an error return.
fails and does not change the nice value if
is negative or greater than 40, and the effective user
of the calling process is not a user
having appropriate privileges.
nice(): AES, SVID2, SVID3, XPG2, XPG3, XPG4