Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
nice(2)			      System Calls Manual		       nice(2)

NAME
       nice - change priority of a process

SYNOPSIS
       #include	<unistd.h>

       int nice(int incr);

DESCRIPTION
       nice()  allows  a process to change its priority.  The invoking process
       must be in a scheduling class that supports  the	 nice()	 system	 call.
       The  priocntl  function	is a more general interface to scheduler func-
       tions.

       nice() 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 posi-
       tive 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	corre-
       sponding	limit.

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
       nice() fails if one or more of the following are	true:

       EINVAL	     nice() is called by a process in a	scheduling class other
		     than time-sharing.

       EPERM	     incr is negative or greater than  40  and	the  effective
		     user id of	the calling process is not super-user.

SEE ALSO
       nice(1),	exec(2), priocntl(2)

				  08 Apr 1994			       nice(2)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=nice&sektion=2&manpath=SunOS+5.5.1>

home | help