OSDN Git Service

LDP: Update original to LDP v3.76
[linuxjm/LDP_man-pages.git] / original / man2 / getpriority.2
index 869db33..9cb370c 100644 (file)
 .\"    Clarified meaning of 0 value for 'who' argument
 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
-.\" FIXME Oct 2008: Denys Vlasenko is working on a PRIO_THREAD feature that
-.\" is likely to get included in mainline; this will need to be documented.
-.\"
-.TH GETPRIORITY 2 2013-02-12 "Linux" "Linux Programmer's Manual"
+.TH GETPRIORITY 2 2014-08-19 "Linux" "Linux Programmer's Manual"
 .SH NAME
 getpriority, setpriority \- get/set program scheduling priority
 .SH SYNOPSIS
@@ -53,9 +50,9 @@ getpriority, setpriority \- get/set program scheduling priority
 .br
 .B #include <sys/resource.h>
 .sp
-.BI "int getpriority(int " which ", int " who );
+.BI "int getpriority(int " which ", id_t " who );
 .br
-.BI "int setpriority(int " which ", int " who ", int " prio );
+.BI "int setpriority(int " which ", id_t " who ", int " prio );
 .SH DESCRIPTION
 The scheduling priority of the process, process group, or user, as
 indicated by
@@ -143,7 +140,7 @@ 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
+Since Linux 2.6.12, this error occurs only if the caller attempts
 to set a process priority outside the range of the
 .B RLIMIT_NICE
 soft resource limit of the target process; see
@@ -182,7 +179,7 @@ The details on the condition for
 .B EPERM
 depend on the system.
 The above description is what POSIX.1-2001 says, and seems to be followed on
-all System V-like systems.
+all System\ V-like systems.
 Linux kernels before 2.6.12 required the real or
 effective user ID of the caller to match
 the real user of the process \fIwho\fP (instead of its effective user ID).
@@ -195,22 +192,9 @@ manner as Linux 2.6.12 and later.
 .LP
 The actual priority range varies between kernel versions.
 Linux before 1.3.36 had \-infinity..15.
-Since kernel 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
-.BR setpriority ()
-and
-.BR 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
+Since kernel 1.3.43, Linux has the range \-20..19.
+On some other systems, the range of nice values is \-20..20.
+
 Including
 .I <sys/time.h>
 is not required these days, but increases portability.
@@ -222,6 +206,22 @@ structure with fields of type
 .I struct timeval
 defined in
 .IR <sys/time.h> .)
+.\"
+.SS C library/kernel ABI differences
+Within the kernel, nice values are actually represented
+using the range 40..1
+(since negative numbers are error codes) and these are the values
+employed by the
+.BR setpriority ()
+and
+.BR 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" .
+(Thus, the kernels 40..1 range corresponds to the
+range \-20..19 as seen by user space.)
 .SH BUGS
 According to POSIX, the nice value is a per-process setting.
 However, under the current Linux/NPTL implementation of POSIX threads,
@@ -233,7 +233,17 @@ which may be made standards conformant in the future.
 .BR nice (1),
 .BR renice (1),
 .BR fork (2),
-.BR capabilities (7)
+.BR capabilities (7),
+.BR sched (7)
 
 .I Documentation/scheduler/sched-nice-design.txt
 in the Linux kernel source tree (since Linux 2.6.23)
+.SH COLOPHON
+This page is part of release 3.76 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.