1 .\" Copyright (c) 1992 Drew Eckhardt <drew@cs.colorado.edu>, March 28, 1992
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1996-11-04 by Eric S. Raymond <esr@thyrsus.com>
28 .\" Modified 2001-06-04 by aeb
29 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
31 .TH NICE 2 2014-04-28 "Linux" "Linux Programmer's Manual"
33 nice \- change process priority
35 .B #include <unistd.h>
37 .BI "int nice(int " inc );
40 Feature Test Macro Requirements for glibc (see
41 .BR feature_test_macros (7)):
45 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
50 to the nice value for the calling process.
51 (A higher nice value means a low priority.)
52 Only the super\%user may specify a negative increment,
54 The range for nice values is described in
57 On success, the new nice value is returned (but see NOTES below).
58 On error, \-1 is returned, and
64 The calling process attempted to increase its priority by
67 but has insufficient privileges.
70 capability is required.
71 (But see the discussion of the
76 SVr4, 4.3BSD, POSIX.1-2001.
77 However, the Linux and (g)libc
78 (earlier than glibc 2.2.4) return value is nonstandard, see below.
79 SVr4 documents an additional
83 SUSv2 and POSIX.1-2001 specify that
85 should return the new nice value.
86 However, the Linux syscall and the
88 library function provided in older versions of (g)libc
89 (earlier than glibc 2.2.4) return 0 on success.
90 The new nice value can be found using
95 is implemented as a library function that calls
97 to obtain the new nice value to be returned to the caller.
98 With this implementation,
99 a successful call can legitimately return \-1.
100 To reliably detect an error, set
102 to 0 before the call, and check its value when
111 .BR capabilities (7),
114 This page is part of release 3.68 of the Linux
117 A description of the project,
118 information about reporting bugs,
119 and the latest version of this page,
121 \%http://www.kernel.org/doc/man\-pages/.