nice
run a program with modified scheduling priority
1. nice.1.man
Manpage of NICE
NICE
Section: User Commands (1)Updated: January 2008
Index Return to Main Contents
NAME
nice - run a program with modified scheduling prioritySYNOPSIS
nice [OPTION] [COMMAND [ARG]...]DESCRIPTION
Run COMMAND with an adjusted niceness, which affects process scheduling. With no COMMAND, print the current niceness. Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable).
- -n, --adjustment=N
- add integer N to the niceness (default 10)
- --help
- display this help and exit
- --version
- output version information and exit
NOTE: your shell may have its own version of nice, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports.
AUTHOR
Written by David MacKenzie.REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.COPYRIGHT
Copyright © 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl>This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
nice(2)The full documentation for nice is maintained as a Texinfo manual. If the info and nice programs are properly installed at your site, the command
- info nice
should give you access to the complete manual.
Index
This document was created by man2html using the manual pages.
Time: 00:21:29 GMT, November 20, 2008
2. nice.2.man
Manpage of NICE
NICE
Section: Linux Programmer's Manual (2)Updated: 2007-07-26
Index Return to Main Contents
NAME
nice - change process prioritySYNOPSIS
#include <unistd.h>int nice(int inc);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getcwd(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
DESCRIPTION
nice() adds inc to the nice value for the calling process. (A higher nice value means a low priority.) Only the superuser may specify a negative increment, or priority increase. The range for nice values is described in getpriority(2).RETURN VALUE
On success, the new nice value is returned (but see NOTES below). On error, -1 is returned, and errno is set appropriately.ERRORS
- EPERM
- The calling process attempted to increase its priority by supplying a negative inc but has insufficient privileges. Under Linux the CAP_SYS_NICE capability is required. (But see the discussion of the RLIMIT_NICE resource limit in setrlimit(2).)
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001. However, the Linux and (g)libc (earlier than glibc 2.2.4) return value is non-standard, see below. SVr4 documents an additional EINVAL error code.NOTES
SUSv2 and POSIX.1-2001 specify that nice() should return the new nice value. However, the Linux syscall and the nice() library function provided in older versions of (g)libc (earlier than glibc 2.2.4) return 0 on success. The new nice value can be found using getpriority(2).Since glibc 2.2.4, nice() is implemented as a library function that calls getpriority(2) to obtain the new nice value to be returned to the caller. With this implementation, a successful call can legitimately return -1. To reliably detect an error, set errno to 0 before the call, and check its value when nice() returns -1.
SEE ALSO
nice(1), fork(2), getpriority(2), setpriority(2), capabilities(7), renice(8)COLOPHON
This page is part of release 2.78 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.
Index
This document was created by man2html using the manual pages.
Time: 00:21:29 GMT, November 20, 2008

