]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
nice.2: Move discussion of handling the -1 success return to RETURN VALUE
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 5 Dec 2016 08:18:40 +0000 (09:18 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 5 Dec 2016 11:13:33 +0000 (12:13 +0100)
This detail was rather hidden in NOTES. Also, rework the text
a little.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/nice.2

index 2b2fe3a4f9d2cdc9613222ac11f206a2d5c98520..913937a1173a07f689fe5a848794ac6b4e5b44b1 100644 (file)
@@ -68,6 +68,13 @@ On success, the new nice value is returned (but see NOTES below).
 On error, \-1 is returned, and
 .I errno
 is set appropriately.
+
+A successful call can legitimately return \-1.
+To detect an error, set
+.I errno
+to 0 before the call, and check whether it is nonzero after
+.BR nice ()
+returns \-1.
 .SH ERRORS
 .TP
 .B EPERM
@@ -113,13 +120,6 @@ Since glibc 2.2.4, the
 wrapper function provided by glibc provides conformance to POSIX.1 by calling
 .BR getpriority (2)
 to obtain the new nice value, which is then returned to the caller.
-With this implementation,
-a successful call can legitimately return \-1.
-To reliably detect an error, set
-.I errno
-to 0 before the call, and check its value when
-.BR nice ()
-returns \-1.
 .SH SEE ALSO
 .BR nice (1),
 .BR renice (1),