mirror of https://github.com/mkerrisk/man-pages
Expanded discussion of relationship between user and kernel
representations of the nice value. Added mention of RLIMIT_NICE and a cross reference to getrlimit.2 under the description of the EACCES error.
This commit is contained in:
parent
7d5b6eb812
commit
d818502d25
|
@ -134,12 +134,21 @@ may fail if:
|
||||||
.B EPERM
|
.B EPERM
|
||||||
A process was located, but its effective user ID did not match
|
A process was located, but its effective user ID did not match
|
||||||
either the effective or the real user ID of the caller,
|
either the effective or the real user ID of the caller,
|
||||||
and (on Linux systems) the caller did not have the
|
and was not privileged (on Linux: did not have the
|
||||||
.B CAP_SYS_NICE
|
.B CAP_SYS_NICE
|
||||||
capability.
|
capability).
|
||||||
.TP
|
.TP
|
||||||
.B EACCES
|
.B EACCES
|
||||||
A non superuser attempted to lower a process priority.
|
The caller attempted to lower a process priority, but did not
|
||||||
|
have the required privilege (on Linux: did not have the
|
||||||
|
.B CAP_SYS_NICE
|
||||||
|
capability).
|
||||||
|
Since Linux 2.6.12, this error only occurs if the caller attempts
|
||||||
|
to set a process priority outside the range of its
|
||||||
|
.B RLIMIT_NICE
|
||||||
|
resource limit; see
|
||||||
|
.BR getrlimit (2)
|
||||||
|
for details.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
The details on the condition for EPERM depend on the system.
|
The details on the condition for EPERM depend on the system.
|
||||||
The above description is what SUSv3 says, and seems to be followed on
|
The above description is what SUSv3 says, and seems to be followed on
|
||||||
|
@ -152,10 +161,20 @@ the effective user ID of the caller to match
|
||||||
the real or effective user ID of the process \fIwho\fP.
|
the real or effective user ID of the process \fIwho\fP.
|
||||||
.LP
|
.LP
|
||||||
The actual priority range varies between kernel versions.
|
The actual priority range varies between kernel versions.
|
||||||
Linux before 1.3.36 had \-infinity..15. Linux since 1.3.43 has \-20..19,
|
Linux before 1.3.36 had \-infinity..15.
|
||||||
and the system call getpriority returns 40..1 for these values
|
Since kerenl 1.3.43 Linux has the range \-20..19.
|
||||||
(since negative numbers are error codes).
|
Within the kernel, nice values are actually represented
|
||||||
The library call converts N into 20\-N.
|
using the corresponding range 40..1
|
||||||
|
(since negative numbers are error codes) and these are the values
|
||||||
|
employed by the
|
||||||
|
.B setpriority
|
||||||
|
and
|
||||||
|
.B getpriority
|
||||||
|
system calls.
|
||||||
|
The glibc wrapper functions for these system calls handle the
|
||||||
|
translations between the user-land and kernel representations
|
||||||
|
of the nice value according to the formula
|
||||||
|
.IR "unice\ =\ 20\ \-\ knice" .
|
||||||
.LP
|
.LP
|
||||||
On some systems, the range of nice values is \-20..20.
|
On some systems, the range of nice values is \-20..20.
|
||||||
.LP
|
.LP
|
||||||
|
|
Loading…
Reference in New Issue