OSDN Git Service

(split) LDP: Update original to LDP v3.53.
[linuxjm/LDP_man-pages.git] / original / man2 / getpriority.2
index 1168a63..b39bdcf 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -28,6 +29,7 @@
 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
+.\" %%%LICENSE_END
 .\"
 .\"     @(#)getpriority.2      6.9 (Berkeley) 3/10/91
 .\"
@@ -43,7 +45,7 @@
 .\" 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 2008-05-29 "Linux" "Linux Programmer's Manual"
+.TH GETPRIORITY 2 2013-02-12 "Linux" "Linux Programmer's Manual"
 .SH NAME
 getpriority, setpriority \- get/set program scheduling priority
 .SH SYNOPSIS
@@ -102,14 +104,14 @@ The
 call sets the priorities of all of the specified processes
 to the specified value.
 Only the superuser may lower priorities.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 Since
 .BR getpriority ()
 can legitimately return the value \-1, it is necessary
 to clear the external variable
 .I errno
 prior to the
-call, then check it afterwards to determine
+call, then check it afterward to determine
 if \-1 is an error or a legitimate value.
 The
 .BR setpriority ()
@@ -141,7 +143,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
@@ -155,7 +157,7 @@ and was not privileged (on Linux: did not have the
 .B CAP_SYS_NICE
 capability).
 But see NOTES below.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 SVr4, 4.4BSD (these function calls first appeared in 4.2BSD),
 POSIX.1-2001.
 .SH NOTES
@@ -166,7 +168,7 @@ The nice value is preserved across
 .BR execve (2).
 
 The degree to which their relative nice value affects the scheduling of
-processes varies across Unix systems, and,
+processes varies across UNIX systems, and,
 on Linux, across kernel versions.
 Starting with kernel 2.6.23, Linux adopted an algorithm that causes
 relative differences in nice values to have a much stronger effect.
@@ -193,7 +195,7 @@ 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.
+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
@@ -220,11 +222,18 @@ structure with fields of type
 .I struct timeval
 defined in
 .IR <sys/time.h> .)
-.SH "SEE ALSO"
+.SH BUGS
+According to POSIX, the nice value is a per-process setting.
+However, under the current Linux/NPTL implementation of POSIX threads,
+the nice value is a per-thread attribute:
+different threads in the same process can have different nice values.
+Portable applications should avoid relying on the Linux behavior,
+which may be made standards conformant in the future.
+.SH SEE ALSO
 .BR nice (1),
+.BR renice (1),
 .BR fork (2),
-.BR capabilities (7),
-.BR renice (8)
-.sp
+.BR capabilities (7)
+
 .I Documentation/scheduler/sched-nice-design.txt
-in the kernel source tree (since Linux 2.6.23).
+in the Linux kernel source tree (since Linux 2.6.23)