nice3
Set program scheduling priority
Usage
#include <unistd.h>
int
nice(int incr);
Library
Standard C Library (libc, -lc)
Overview
This interface is obsoleted by setpriority(2).
The nice() function adds incr to the scheduling priority of the process. The priority is a value in the range -20 to 20. The default priority is 0; lower priorities cause more favorable scheduling. Only the super-user may lower priorities.
Children inherit the priority of their parent processes via fork(2).
Return values
Upon successful completion, nice() returns 0, and errno is unchanged. Otherwise, -1 is returned, the process' nice value is not changed, and errno is set to indicate the error.
Errors
The nice() function will fail if:
- [EPERM]
-
The incr argument is negative and the caller does not have appropriate privileges.
Releases
87 releases since FreeBSD 2.0.5-RELEASE; the text changed 42 times.