nice(2) CLIX nice(2)
NAME
nice - Changes priority of a process
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
int nice(
int incr );
PARAMETERS
incr Specifies the value to be added to the current nice value of the
calling process.
DESCRIPTION
The nice() function adds the value of incr to the nice value of the
calling process. A process's nice value is a non-negative number for
which a more positive value results in lower CPU priority.
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.
EXAMPLES
1. To lower the priority of the process currently running:
if (nice(10) == -1)
perror("nice failed");
2. To determine the calling process' current nice value:
current_nice_value = nice(0);
RETURN VALUES
Upon successful completion, nice() returns the new nice value minus 20.
Otherwise, a value of -1 is returned and errno is set to indicate the
error.
ERRORS
[EPERM] The nice() function will fail and not change the nice value if
2/94 - Intergraph Corporation 1
nice(2) CLIX nice(2)
incr is negative or greater than 39 and the effective user ID of
the calling process is not superuser.
RELATED INFORMATION
Commands: nice(1)
Functions: exec(2)
2 Intergraph Corporation - 2/94