70 lines
1.7 KiB
Groff
70 lines
1.7 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g2.nice @(#)nice 41.4 of 5/26/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1989, 1990 AT&T
|
|
.nr X
|
|
.if \nX=0 .ds x} nice 2 "" "\&"
|
|
.if \nX=1 .ds x} nice 2 ""
|
|
.if \nX=2 .ds x} nice 2 "" "\&"
|
|
.if \nX=3 .ds x} nice "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4nice\f1 \- change priority of a time-sharing process
|
|
.SH SYNOPSIS
|
|
\f4#include <unistd.h>
|
|
.sp .5
|
|
\f4int nice(int incr);\f1
|
|
.SH DESCRIPTION
|
|
\f4nice\fP
|
|
allows a process in the time-sharing scheduling class to change its priority.
|
|
The
|
|
\f4sched_setscheduler\fP and \f4schedctl\fP
|
|
system calls are more general interfaces to scheduler functions.
|
|
.PP
|
|
\f4nice\fP
|
|
adds the value of
|
|
.I 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
|
|
.SM CPU
|
|
priority.
|
|
.PP
|
|
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.
|
|
.PP
|
|
.TP 14
|
|
\f4EPERM\fP
|
|
\f4nice\fP
|
|
fails and does not change the nice value if
|
|
.I incr\^
|
|
is negative or greater than 40 and
|
|
the effective user ID of the calling process is not super-user.
|
|
.TP
|
|
\f4EINVAL\fP
|
|
\f4nice\fP
|
|
fails if called by a process in a scheduling class other than time-sharing.
|
|
.SH SEE ALSO
|
|
\f4exec\fP(2),
|
|
\f4setpriority\fP(2),
|
|
\f4sched_setscheduler\fP(2).
|
|
\f4schedctl\fP(2).
|
|
.sp .2
|
|
\f4csh\fP(1),
|
|
\f4sh\fP(1),
|
|
\f4nice\fP(1).
|
|
.SH DIAGNOSTICS
|
|
Upon successful completion,
|
|
\f4nice\fP
|
|
returns the new nice value minus 20.
|
|
Otherwise, a value of \-1 is returned and
|
|
\f4errno\fP
|
|
is set to indicate the error.
|
|
.\" @(#)nice.2 6.2 of 9/6/83
|
|
.Ee
|