Differences between version 6 and predecessor to the previous major change of nice(2).
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Monday, June 6, 2005 10:38:20 pm | by SidSwami | Revert |
Older page: | version 3 | Last edited on Sunday, March 16, 2003 5:54:09 pm | by PerryLorier | Revert |
@@ -9,18 +9,17 @@
nice(2) adds ''inc'' to the nice value for the calling pid. (A large nice value means a low priority.) Only the super- user may specify a negative increment, or
priority increase.
!!RETURN VALUE
-On success, zero
is returned. On error,
-1 is returned, and ''errno'' is set appropriately
.
+On success, the new nice variable
is returned.
On failure
-1 is returned. Since -1 is a valid return for nice(2), set errno(3) to 0 before calling nice(2)
, and check it
's value afterwards
.
!!ERRORS
;[EPERM]: A non-super user attempts to do a priority increase by supplying a negative ''inc''.
!!CONFORMING TO
SVr4, SVID EXT, AT
!!NOTES
-Note that the routine is documented in SUSv2 to return the new nice value, while the Linux syscall and
(g)libc (earlier than glibc 2.2.4) routines
return 0 on success. The
new nice value can
be found using
getpriority(2). Note that an implementation in which __nice__ returns the new nice value can legitimately return -1. To reliably detect an
-error, set ''errno'' to 0 before the call, and check its value when __nice__ returns -1
.
+Older
(g)libc (earlier than glibc 2.2.4) return 0 on success, and the
new nice value should
be found by calling
getpriority(2).
!!SEE ALSO
-nice(1), getpriority(2), setpriority(2), fork(2), renice(1)
+nice(1), getpriority(2), setpriority(2), fork(2), renice(1), sched_getscheduler(2), sched_getparam(2
)