change priority of a time-sharing process
int nice(int incr);
allows a member of the time-sharing scheduling class to change its priority.
adds the value of
to the nice value of the calling process.
The nice value
is a non-negative 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.
(The default nice value is 20.)
Requests for values above or below these limits
result in the nice value being set to the corresponding limit,
unless the calling process has the P_TSHAR privilege.
On success, nice returns the new nice value minus
On failure, nice returns -1 and sets errno to identify the error.
In the following conditions, nice fails and sets errno to:
incr is negative or greater than 39 and the calling process
does not have the P_TSHAR privilege.
The process was in a scheduling class other than time-sharing.
is a more general interface to scheduler functions.
Considerations for threads programming
The nice system call should not be used to modify the priority of threads.
Considerations for lightweight processes
Scheduling context is not a process attribute,
a separate context is internally maintained for each LWP.
A call to nice shall bias only the priority of
the calling LWP by the applied nice value.
A process can contain LWPs belonging to different scheduling classes.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005