OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / nice.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt <drew@cs.colorado.edu>, March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
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>
30 .\"
31 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
32 .\"         all rights reserved.
33 .\" Translated 1997-06-26, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
34 .\" Updated 2001-06-25, Kentaro Shirakata <argrath@ub32.org>
35 .\" Updated 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Updated 2005-10-07, Akihiro MOTOKI
37 .\"
38 .TH NICE 2 2007-07-26 "Linux" "Linux Programmer's Manual"
39 .SH Ì¾Á°
40 nice \- ¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ë
41 .SH ½ñ¼°
42 .B #include <unistd.h>
43 .sp
44 .BI "int nice(int " inc );
45 .sp
46 .in -4n
47 .\"O Feature Test Macro Requirements for glibc (see
48 .\"O .BR feature_test_macros (7)):
49 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
50 .RB ( feature_test_macros (7)
51 »²¾È):
52 .in
53 .sp
54 .BR nice ():
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
56 .\"O .SH DESCRIPTION
57 .SH ÀâÌÀ
58 .\"O .BR nice ()
59 .\"O adds
60 .\"O .I inc
61 .\"O to the nice value for the calling process.
62 .\"O (A higher nice value means a low priority.)
63 .\"O Only the super\%user may specify a negative increment,
64 .\"O or priority increase.
65 .\"O The range for nice values is described in
66 .\"O .BR getpriority (2).
67 .BR nice ()
68 ¤Ï
69 .I inc
70 ¤ÎÃͤò
71 .B nice
72 ¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Î nice Ãͤ˲䨤ë
73 (nice Ãͤ¬Â礭¤¤¿ôÃͤۤÉÄ㤤ͥÀèÅÙ¤òɽ¤¹)¡£
74 Éé¤Î¿ô¤ò»ØÄꤹ¤ë¡¢¤Ä¤Þ¤ê¡¢°ÊÁ°¤è¤ê¤âÍ¥ÀèÅÙ¤ò¾å¤²¤ë¤È¤¤¤¦»ØÄ꤬¤Ç¤­¤ë¤Î¤Ï
75 ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤Ç¤¢¤ë¡£
76 nice ÃͤÎÈϰϤˤĤ¤¤Æ¤Ï
77 .BR getpriority (2)
78 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£
79 .\"O .SH "RETURN VALUE"
80 .SH ÊÖ¤êÃÍ
81 .\"O On success, the new nice value is returned (but see NOTES below).
82 .\"O On error, \-1 is returned, and
83 .\"O .I errno
84 .\"O is set appropriately.
85 À®¸ù¤·¤¿¾ì¹ç¡¢¿·¤·¤¤ nice Ãͤ¬ÊÖ¤ë (⤷¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È)¡£
86 ¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ
87 .I errno
88 ¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£
89 .\"O .SH ERRORS
90 .SH ¥¨¥é¡¼
91 .TP
92 .B EPERM
93 .\"O A non-super user attempts to do a priority increase
94 .\"O by supplying a negative
95 ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼°Ê³°¤¬
96 .I inc
97 ¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¡£
98 .\"O The calling process attempted to increase its priority by
99 .\"O supplying a negative
100 .\"O .I inc
101 .\"O but has insufficient privileges.
102 .\"O Under Linux the
103 .\"O .B CAP_SYS_NICE
104 .\"O capability is required.
105 .\"O (But see the discussion of the
106 .\"O .B RLIMIT_NICE
107 .\"O resource limit in
108 .\"O .BR setrlimit (2).)
109 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬
110 .I inc
111 ¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¤¬¡¢
112 ½½Ê¬¤Ê¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
113 Linux ¤Ç¤Ï
114 .B CAP_SYS_NICE
115 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£
116 .RB ( setrlimit (2)
117 ¤Î¥ê¥½¡¼¥¹¾å¸Â
118 .B RLIMIT_NICE
119 ¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¾È¤Î¤³¤È)¡£
120 .\"O .SH "CONFORMING TO"
121 .SH ½àµò
122 .\"O SVr4, 4.3BSD, POSIX.1-2001.
123 .\"O However, the Linux and (g)libc
124 .\"O (earlier than glibc 2.2.4) return value is nonstandard, see below.
125 .\"O SVr4 documents an additional
126 .\"O .B EINVAL
127 .\"O error code.
128 SVr4, 4.3BSD, POSIX.1-2001.
129 ¤·¤«¤·¡¢Linux ¤È (2.2.4¤è¤ê¸Å¤¤) (g)libc ¤Ç¤ÏÊÖ¤êÃͤÏɸ½à¤È°Û¤Ê¤ë¡£
130 ¾ÜºÙ¤Ï°Ê²¼¤ò»²¾È¤Î¤³¤È¡£
131 SVr4 ¤Ë¤Ï¾¤Ë
132 .B EINVAL
133 ¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
134 .\"O .SH NOTES
135 .SH Ãí°Õ
136 .\"O SUSv2 and POSIX.1-2001 specify that
137 .\"O .BR nice ()
138 .\"O should return the new nice value.
139 .\"O However, the Linux syscall and the
140 .\"O .BR nice ()
141 .\"O library function provided in older versions of (g)libc
142 .\"O (earlier than glibc 2.2.4) return 0 on success.
143 .\"O The new nice value can be found using
144 .\"O .BR getpriority (2).
145 SUSv2 ¤È POSIX 1003.1-2003 ¤Ç¤Ï¡¢
146 .BR nice ()
147 ¤Ï¿·¤·¤¤ nice ÃͤòÊÖ¤¹¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
148 °ìÊý¡¢Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤È (2.2.4 ¤è¤ê¸Å¤¤) (g)libc ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï
149 À®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£¿·¤·¤¤ nice ÃͤÏ
150 .BR getpriority (2)
151 ¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£
152
153 .\"O Since glibc 2.2.4,
154 .\"O .BR nice ()
155 .\"O is implemented as a library function that calls
156 .\"O .BR getpriority (2)
157 .\"O to obtain the new nice value to be returned to the caller.
158 .\"O With this implementation,
159 .\"O a successful call can legitimately return \-1.
160 glibc 2.2.4 °Ê¹ß¤Ç¤Ï¡¢
161 .BR nice ()
162 ¤Ï
163 .BR getpriority (2)
164 ¤ò¸Æ¤Ó½Ð¤¹¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢
165 ¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹¿·¤·¤¤ nice Ãͤò
166 .BR getpriority (2)
167 ¤ò¸Æ¤Ó½Ð¤·¤Æ¼èÆÀ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
168 ¤³¤Î¼ÂÁõ¤Ç¤Ï¡¢Àµ¾ï¤ÊÆ°ºî¤Ç¤â \-1 ¤¬ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
169 .\"O To reliably detect an error, set
170 .\"O .I errno
171 .\"O to 0 before the call, and check its value when
172 .\"O .BR nice ()
173 .\"O returns \-1.
174 ³Î¼Â¤Ë¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¤Ï¡¢
175 ¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë
176 .I errno
177 ¤Ë 0 ¤òÀßÄꤷ¡¢
178 .BR nice ()
179 ¤¬ \-1 ¤òÊÖ¤·¤¿¤È¤­¤Ë errno ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤ÈÎɤ¤¡£
180 .\"O .SH "SEE ALSO"
181 .SH ´ØÏ¢¹àÌÜ
182 .BR nice (1),
183 .BR fork (2),
184 .BR getpriority (2),
185 .BR setpriority (2),
186 .BR capabilities (7),
187 .BR renice (8)