aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2005-07-28 13:21:39 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2005-07-28 13:21:39 +0000
commitd818502d25778df1e5ebbceddb05e6fd55e53a23 (patch)
treebb1beb52bc05b7809bca9748b67fbacd84373541
parent7d5b6eb81214107ca34229fd6f0abe89b13a4929 (diff)
downloadman-pages-d818502d25778df1e5ebbceddb05e6fd55e53a23.tar.gz
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.
-rw-r--r--man2/getpriority.233
1 files changed, 26 insertions, 7 deletions
diff --git a/man2/getpriority.2 b/man2/getpriority.2
index 9453bb223b..1ed1e1967d 100644
--- a/man2/getpriority.2
+++ b/man2/getpriority.2
@@ -134,12 +134,21 @@ may fail if:
.B EPERM
A process was located, but its effective user ID did not match
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
-capability.
+capability).
.TP
.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
The details on the condition for EPERM depend on the system.
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.
.LP
The actual priority range varies between kernel versions.
-Linux before 1.3.36 had \-infinity..15. Linux since 1.3.43 has \-20..19,
-and the system call getpriority returns 40..1 for these values
-(since negative numbers are error codes).
-The library call converts N into 20\-N.
+Linux before 1.3.36 had \-infinity..15.
+Since kerenl 1.3.43 Linux has the range \-20..19.
+Within the kernel, nice values are actually represented
+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
On some systems, the range of nice values is \-20..20.
.LP