OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / getrlimit.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992
4 .\" and Copyright (c) 2002, 2004, 2005, 2008 Michael Kerrisk
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Modified by Michael Haardt <michael@moria.de>
27 .\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
28 .\" Modified 1996-01-13 by Arnt Gulbrandsen <agulbra@troll.no>
29 .\" Modified 1996-01-22 by aeb, following a remark by
30 .\"          Tigran Aivazian <tigran@sco.com>
31 .\" Modified 1996-04-14 by aeb, following a remark by
32 .\"          Robert Bihlmeyer <robbe@orcus.ping.at>
33 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
34 .\" Modified 2001-05-04 by aeb, following a remark by
35 .\"          Havard Lygre <hklygre@online.no>
36 .\" Modified 2001-04-17 by Michael Kerrisk <mtk.manpages@gmail.com>
37 .\" Modified 2002-06-13 by Michael Kerrisk <mtk.manpages@gmail.com>
38 .\"     Added note on nonstandard behavior when SIGCHLD is ignored.
39 .\" Modified 2002-07-09 by Michael Kerrisk <mtk.manpages@gmail.com>
40 .\"     Enhanced descriptions of 'resource' values for [gs]etrlimit()
41 .\" Modified 2003-11-28 by aeb, added RLIMIT_CORE
42 .\" Modified 2004-03-26 by aeb, added RLIMIT_AS
43 .\" Modified 2004-06-16 by Michael Kerrisk <mtk.manpages@gmail.com>
44 .\"     Added notes on CAP_SYS_RESOURCE
45 .\"
46 .\" 2004-11-16 -- mtk: the getrlimit.2 page, which formally included
47 .\" coverage of getrusage(2), has been split, so that the latter
48 .\" is now covered in its own getrusage.2.
49 .\"
50 .\" Modified 2004-11-16, mtk: A few other minor changes
51 .\" Modified 2004-11-23, mtk
52 .\"     Added notes on RLIMIT_MEMLOCK, RLIMIT_NPROC, and RLIMIT_RSS
53 .\"             to "CONFORMING TO"
54 .\" Modified 2004-11-25, mtk
55 .\"     Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel
56 .\"             2.6.9 changes.
57 .\"     Added note on RLIMIT_CPU error in older kernels
58 .\" 2004-11-03, mtk, Added RLIMIT_SIGPENDING
59 .\" 2005-07-13, mtk, documented RLIMIT_MSGQUEUE limit.
60 .\" 2005-07-28, mtk, Added descriptions of RLIMIT_NICE and RLIMIT_RTPRIO
61 .\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME
62 .\"
63 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
64 .\"         all rights reserved.
65 .\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
66 .\" Updated and Modified 2001-06-02, Yuichi SATO <ysato444@yahoo.co.jp>
67 .\" Updated and Modified 2001-08-18, Yuichi SATO
68 .\" Updated and Modified 2002-08-25, Yuichi SATO
69 .\" Updated and Modified 2004-01-17, Yuichi SATO
70 .\" Updated and Modified 2004-12-30, Yuichi SATO
71 .\" Updated and Modified 2005-09-10, Yuichi SATO
72 .\" Updated and Modified 2005-10-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
73 .\" Updated and Modified 2005-10-27, Akihiro MOTOKI
74 .\" Updated and Modified 2006-04-15, Akihiro MOTOKI, Catch up to LDP v2.29
75 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
76 .\" Updated 2008-10-13, Akihiro MOTOKI, LDP v3.11
77 .\"
78 .\"WORD:        resource                »ñ¸»
79 .\"WORD:        limit                   À©¸Â
80 .\"
81 .TH GETRLIMIT 2 2008-10-06 "Linux" "Linux Programmer's Manual"
82 .\"O .SH NAME
83 .SH Ì¾Á°
84 .\"O getrlimit, setrlimit \- get/set resource limits
85 getrlimit, setrlimit \- »ñ¸»¤ÎÀ©¸Â¤ò¼èÆÀ/ÀßÄꤹ¤ë
86 .\"O .SH SYNOPSIS
87 .SH ½ñ¼°
88 .B #include <sys/time.h>
89 .br
90 .B #include <sys/resource.h>
91 .sp
92 .BI "int getrlimit(int " resource ", struct rlimit *" rlim );
93 .br
94 .BI "int setrlimit(int " resource ", const struct rlimit *" rlim );
95 .\"O .SH DESCRIPTION
96 .SH ÀâÌÀ
97 .\"O .BR getrlimit ()
98 .\"O and
99 .\"O .BR setrlimit ()
100 .\"O get and set resource limits respectively.
101 .BR getrlimit ()
102 ¤È
103 .BR setrlimit ()
104 ¤Ï¤½¤ì¤¾¤ì»ñ¸» (resource) ¤ÎÀ©¸Â (limit) ¤ÎÀßÄê¤È¼èÆÀ¤ò¹Ô¤¦¡£
105 .\"O Each resource has an associated soft and hard limit, as defined by the
106 .\"O .I rlimit
107 .\"O structure (the
108 .\"O .I rlim
109 .\"O argument to both
110 .\"O .BR getrlimit ()
111 .\"O and
112 .\"O .BR setrlimit ()):
113 ³Æ¥ê¥½¡¼¥¹¤Ë¤Ï¡¢¤½¤ì¤ËÂбþ¤¹¤ë¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤¬¤¢¤ë¡£
114 ¥ê¥ß¥Ã¥È¤Ï
115 .RB ( getrlimit ()
116 ¤È
117 .BR setrlimit ()
118 ¤Î
119 .I rlim
120 °ú¤­¿ô¤Ç¤¢¤ë)
121 .I rlimit
122 ¹½Â¤ÂΤÇÄêµÁ¤µ¤ì¤ë:
123 .PP
124 .in +4n
125 .nf
126 struct rlimit {
127 .\"O     rlim_t rlim_cur;  /* Soft limit */
128 .\"O     rlim_t rlim_max;  /* Hard limit (ceiling for rlim_cur) */
129     rlim_t rlim_cur;  /* ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È */
130     rlim_t rlim_max;  /* ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È
131                          (rlim_cur ¤è¤ê¾®¤µ¤¯¤Ê¤¤) */
132 };
133
134 .fi
135 .in
136 .\"O The soft limit is the value that the kernel enforces for the
137 .\"O corresponding resource.
138 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ï¡¢¥«¡¼¥Í¥ë¤¬Âбþ¤¹¤ë¥ê¥½¡¼¥¹¤ËÂФ·¤Æ²Ý¤¹À©¸ÂÃͤǤ¢¤ë¡£
139 .\"O The hard limit acts as a ceiling for the soft limit:
140 ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ï¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Î¾å¸Â¤È¤·¤ÆƯ¤¯¡£
141 .\"O an unprivileged process may only set its soft limit to a value in the
142 .\"O range from 0 up to the hard limit, and (irreversibly) lower its hard limit.
143 Æø¢¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹¤Ï¡¢¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤ÎÃͤò
144 0 ¤«¤é¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ÎÈϰϤËÀßÄꤹ¤ë¤³¤È¤È¡¢
145 ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò²¼¤²¤ë¤³¤È¤Î¤ß¤¬¤Ç¤­¤ë
146 (°ìÅÙ²¼¤²¤¿¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ï¾å¤²¤é¤ì¤Ê¤¤)¡£
147 .\"O A privileged process (under Linux: one with the
148 .\"O .B CAP_SYS_RESOURCE
149 .\"O capability) may make arbitrary changes to either limit value.
150 Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï
151 .B CAP_SYS_RESOURCE
152 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Ï
153 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤È¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò¼«Í³¤ËÊѹ¹¤Ç¤­¤ë¡£
154 .PP
155 .\"O The value
156 .\"O .B RLIM_INFINITY
157 .\"O denotes no limit on a resource (both in the structure returned by
158 .\"O .BR getrlimit ()
159 .\"O and in the structure passed to
160 .\"O .BR setrlimit ()).
161 ÃÍ
162 .B RLIM_INFINITY
163 ¤Ï¥ê¥½¡¼¥¹¤ËÀ©¸Â¤¬¤Ê¤¤¤³¤È¤òɽ¤¹
164 (¤³¤ÎÃͤÏ
165 .BR getrlimit ()
166 ¤¬ÊÖ¤¹¹½Â¤ÂΤÈ
167 .BR setrlimit ()
168 ¤ËÅϤ¹¹½Â¤ÂΤÎξÊý¤Ç»ÈÍѤµ¤ì¤ë)¡£
169 .PP
170 .\"O .I resource
171 .\"O must be one of:
172 .I resource
173 ¤Ï¼¡¤Î¤¤¤º¤ì¤« 1 ¤Ä¤Ç¤¢¤ë¡£
174 .TP
175 .B RLIMIT_AS
176 .\"O The maximum size of the process's virtual memory (address space) in bytes.
177 ¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê (¥¢¥É¥ì¥¹¶õ´Ö) ¤ÎºÇÂ祵¥¤¥º (¥Ð¥¤¥Èñ°Ì)¡£
178 .\"O .\" since 2.0.27 / 2.1.12
179 .\" 2.0.27 / 2.1.12 °Ê¹ß¡£
180 .\"O This limit affects calls to
181 .\"O .BR brk (2),
182 .\"O .BR mmap (2)
183 .\"O and
184 .\"O .BR mremap (2),
185 .\"O which fail with the error
186 .\"O .B ENOMEM
187 .\"O upon exceeding this limit.
188 .\"O Also automatic stack expansion will fail
189 .\"O (and generate a
190 .\"O .B SIGSEGV
191 .\"O that kills the process if no alternate stack
192 .\"O has been made available via
193 .\"O .BR sigaltstack (2)).
194 ¤³¤ÎÀ©¸Â¤Ï
195 .BR brk (2),
196 .BR mmap (2),
197 .BR mremap (2)
198 ¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤·¡¢¤³¤ÎÀ©¸Â¤òĶ¤¨¤¿¾ì¹ç¤Ï
199 ¥¨¥é¡¼
200 .B ENOMEM
201 ¤Ç¼ºÇÔ¤¹¤ë¡£
202 ¤Þ¤¿¼«Æ°Åª¤Ê¥¹¥¿¥Ã¥¯³ÈÄ¥¤Ë¤â¼ºÇÔ¤¹¤ë
203 (¤µ¤é¤Ë
204 .BR sigaltstack (2)
205 ¤ò»È¤Ã¤¿ÂåÂØ¥¹¥¿¥Ã¥¯¤òÍøÍѲÄǽ¤Ë¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
206 .B SIGSEGV
207 ¤òÀ¸À®¤·¤Æ¤½¤Î¥×¥í¥»¥¹¤ò kill ¤¹¤ë)¡£
208 .\"O Since the value is a \fIlong\fP, on machines with a 32-bit \fIlong\fP
209 .\"O either this limit is at most 2 GiB, or this resource is unlimited.
210 ¤³¤ÎÃͤϠ\fIlong\fP ·¿¤Ê¤Î¤Ç¡¢32 ¥Ó¥Ã¥È¤Î \fIlong\fP ·¿¤ò»ý¤Ä¥Þ¥·¥ó¤Ç¤Ï¡¢
211 ¤³¤ÎÀ©¸Â¤ÏºÇÂç¤Ç 2 GiB ¤Ë¤Ê¤ë¤«¡¢¤³¤Î»ñ¸»¤¬ÌµÀ©¸Â¤Ë¤Ê¤ë¡£
212 .TP
213 .B RLIMIT_CORE
214 .\"O Maximum size of
215 .\"O .I core
216 .\"O file.
217 .\"O When 0 no core dump files are created.
218 .I core
219 ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¡£
220 0 ¤Î¾ì¹ç¡¢core ¥Õ¥¡¥¤¥ë¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£
221 .\"O When nonzero, larger dumps are truncated to this size.
222 0 °Ê³°¤Î¾ì¹ç¡¢¤³¤Î¥µ¥¤¥º¤è¤êÂ礭¤¤¥À¥ó¥×¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë¡£
223 .TP
224 .B RLIMIT_CPU
225 .\"O CPU time limit in seconds.
226 CPU »þ´Ö¤Î¾å¸Â (Éÿô)¡£
227 .\"O When the process reaches the soft limit, it is sent a
228 .\"O .B SIGXCPU
229 .\"O signal.
230 ¥×¥í¥»¥¹¤¬¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤Ë¡¢
231 .B SIGXCPU
232 ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
233 .\"O The default action for this signal is to terminate the process.
234 ¤³¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»¤Ç¤¢¤ë¡£
235 .\"O However, the signal can be caught, and the handler can return control to
236 .\"O the main program.
237 ¤¿¤À¤·¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤·¤Æ¡¢¥Ï¥ó¥É¥é¤¬¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ë
238 À©¸æ¤òÊÖ¤¹¤³¤È¤â¤Ç¤­¤ë¡£
239 .\"O If the process continues to consume CPU time, it will be sent
240 .\"O .B SIGXCPU
241 .\"O once per second until the hard limit is reached, at which time
242 .\"O it is sent
243 .\"O .BR SIGKILL .
244 ¥×¥í¥»¥¹¤¬ CPU »þ´Ö¤ò»È¤¤Â³¤±¤¿¾ì¹ç¤Ï¡¢
245 ¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 ÉÃËè¤Ë¥×¥í¥»¥¹¤Ë
246 .B SIGXCPU
247 ¤òÁ÷¤ê¡¢
248 ¥Ï¡¼¥É¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È
249 .B SIGKILL
250 ¤òÁ÷¤ë¡£
251 .\"O (This latter point describes Linux 2.2 through 2.6 behavior.
252 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ²á¤·¤¿¤È¤­¤ÎÆ°ºî¤Ï¡¢
253 Linux 2.2 ¤«¤é 2.6 ¤Î¤â¤Î¤Ç¤¢¤ë¡£
254 .\"O Implementations vary in how they treat processes which continue to
255 .\"O consume CPU time after reaching the soft limit.
256 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤òĶ¤¨¤Æ CPU »þ´Ö¤ò»È¤¤Â³¤±¤ë¥×¥í¥»¥¹¤Î
257 °·¤¤Êý¤Ë¤Ä¤¤¤Æ¤Î¼ÂÁõ¤ÏÊѲ½¤·¤Æ¤­¤Æ¤¤¤ë¡£
258 .\"O Portable applications that need to catch this signal should
259 .\"O perform an orderly termination upon first receipt of
260 .\"O .BR SIGXCPU .)
261 ¤³¤Î¥·¥°¥Ê¥ë¤ò¥­¥ã¥Ã¥Á¤¹¤ëɬÍפΤ¢¤ë
262 °Ü¿¢À­¤ò¹Í¤¨¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¡¢
263 ºÇ½é¤Ë
264 .B SIGXCPU
265 ¤ò¼õ¤±¼è¤Ã¤¿»þÅÀ¤ÇÀµ¤·¤¯½ªÎ»¤¹¤Ù¤­¤Ç¤¢¤ë¡£
266 .TP
267 .B RLIMIT_DATA
268 .\"O The maximum size of the process's data segment (initialized data,
269 .\"O uninitialized data, and heap).
270 ¥×¥í¥»¥¹¤Î¥Ç¡¼¥¿¥»¥°¥á¥ó¥È
271 (½é´ü²½¤µ¤ì¤¿¥Ç¡¼¥¿¡¦½é´ü²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¡¦¥Ò¡¼¥×) ¤ÎºÇÂçÃÍ¡£
272 .\"O This limit affects calls to
273 .\"O .BR brk (2)
274 .\"O and
275 .\"O .BR sbrk (2),
276 .\"O which fail with the error
277 .\"O .B ENOMEM
278 .\"O upon encountering the soft limit of this resource.
279 ¤³¤Î¥ê¥ß¥Ã¥È¤Ï
280 .BR brk (2)
281 ¤È
282 .BR sbrk (2)
283 ¤Î¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤¹¤ë¡£
284 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤³¤Î¥ê¥½¡¼¥¹¤Î¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢
285 ¥¨¥é¡¼
286 .B ENOMEM
287 ¤Ç¼ºÇÔ¤¹¤ë¡£
288 .TP
289 .B RLIMIT_FSIZE
290 .\"O The maximum size of files that the process may create.
291 ¥×¥í¥»¥¹¤¬ºîÀ®¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÎºÇÂçÃÍ¡£
292 .\"O Attempts to extend a file beyond this limit result in delivery of a
293 .\"O .B SIGXFSZ
294 .\"O signal.
295 ¤³¤Î¥µ¥¤¥º¤òĶ¤¨¤Æ¥Õ¥¡¥¤¥ë¤ò³ÈÄ¥¤¹¤ë¤È¡¢
296 .B SIGXFSZ
297 ¥·¥°¥Ê¥ë¤òÁ÷¤ë¡£
298 .\"O By default, this signal terminates a process, but a process can
299 .\"O catch this signal instead, in which case the relevant system call (e.g.,
300 .\"O .BR write (2),
301 .\"O .BR truncate (2))
302 .\"O fails with the error
303 .\"O .BR EFBIG .
304 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î¥·¥°¥Ê¥ë¤Ï¥×¥í¥»¥¹¤ò½ªÎ»¤¹¤ë¡£
305 ¥×¥í¥»¥¹¤ò¥­¥ã¥Ã¥Á¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¤¬¡¢
306 ´ØÏ¢¤¹¤ë¥·¥¹¥Æ¥à¥³¡¼¥ë
307 .RB ( write (2),
308 .BR truncate (2)
309 ¤Ê¤É) ¤Ï¥¨¥é¡¼
310 .B EFBIG
311 ¤Ç¼ºÇÔ¤¹¤ë¡£
312 .TP
313 .\"O .BR RLIMIT_LOCKS " (Early Linux 2.4 only)"
314 .BR RLIMIT_LOCKS " (½é´ü¤Î Linux 2.4 ¤Î¤ß)"
315 .\"O .\" to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65
316 .\" Àµ³Î¤Ë¤Ï Linux 2.4.0-test9 ¤Î¤ß¡£2.4.25 / 2.5.65 ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë¡£
317 .\"O A limit on the combined number of
318 .\"O .BR flock (2)
319 .\"O locks and
320 .\"O .BR fcntl (2)
321 .\"O leases that this process may establish.
322 ¤³¤Î¥×¥í¥»¥¹¤¬¼Â¹Ô¤Ç¤­¤ë
323 .BR flock (2)
324 ¥í¥Ã¥¯¿ô¤È
325 .BR fcntl (2)
326 ¥ê¡¼¥¹¿ô¤Î¹ç·×ÃͤòÀ©¸Â¤¹¤ë¡£
327 .TP
328 .B RLIMIT_MEMLOCK
329 .\"O The maximum number of bytes of memory that may be locked
330 .\"O into RAM.
331 RAM Æâ¤Ë¥í¥Ã¥¯¤Ç¤­¤ë¥á¥â¥ê¤ÎºÇÂç¥Ð¥¤¥È¿ô¡£
332 .\"O In effect this limit is rounded down to the nearest multiple
333 .\"O of the system page size.
334 ¼ÂºÝ¤Ë¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥·¥¹¥Æ¥à¥Ú¡¼¥¸¥µ¥¤¥º¤ÎºÇ¤â¶á¤¤ÇÜ¿ô¤Ë
335 ÀÚ¤ê¼Î¤Æ¤Æ´Ý¤á¤é¤ì¤ë¡£
336 .\"O This limit affects
337 .\"O .BR mlock (2)
338 .\"O and
339 .\"O .BR mlockall (2)
340 .\"O and the
341 .\"O .BR mmap (2)
342 .\"O .B MAP_LOCKED
343 .\"O operation.
344 ¤³¤ÎÀ©¸Â¤Ï
345 .BR mlock (2),
346 .BR mlockall (2),
347 .BR mmap (2)
348 ¤Î
349 .B MAP_LOCKED
350 Áàºî¤Ë±Æ¶Á¤¹¤ë¡£
351 .\"O Since Linux 2.6.9 it also affects the
352 .\"O .BR shmctl (2)
353 .\"O .B SHM_LOCK
354 .\"O operation, where it sets a maximum on the total bytes in
355 .\"O shared memory segments (see
356 .\"O .BR shmget (2))
357 .\"O that may be locked by the real user ID of the calling process.
358 Linux 2.6.9 °Ê¹ß¤Ç¤Ï
359 .BR shmctl (2)
360 .B SHM_LOCK
361 Áàºî¤Ë¤â±Æ¶Á¤¹¤ë¡£
362 ¤³¤ÎÁàºî¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤Ë¥í¥Ã¥¯¤µ¤ì¤ë
363 ¶¦Í­¥á¥â¥ê¥»¥°¥á¥ó¥È
364 .RB ( shmget (2)
365 ¤ò»²¾È) ¤Î¹ç·×¥Ð¥¤¥È¿ô¤ÎºÇÂçÃͤòÀßÄꤹ¤ë¡£
366 .\"O The
367 .\"O .BR shmctl (2)
368 .\"O .B SHM_LOCK
369 .\"O locks are accounted for separately from the per-process memory
370 .\"O locks established by
371 .\"O .BR mlock (2),
372 .\"O .BR mlockall (2),
373 .\"O and
374 .\"O .BR mmap (2)
375 .\"O .BR MAP_LOCKED ;
376 .\"O a process can lock bytes up to this limit in each of these
377 .\"O two categories.
378 .BR shmctl (2)
379 .B SHM_LOCK
380 ¤Ë¤è¤ë¥í¥Ã¥¯¤Ï¡¢
381 .BR mlock (2),
382 .BR mlockall (2),
383 .BR mmap (2)
384 ¤Î
385 .B MAP_LOCKED
386 ¤Ë¤è¤Ã¤Æ³ÎΩ¤µ¤ì¤ë¥×¥í¥»¥¹Ëè¤Î¥á¥â¥ê¥í¥Ã¥¯¤È¤Ïʬ¤±¤Æ¿ô¤¨¤ë¡£
387 1 ¤Ä¤Î¥×¥í¥»¥¹¤Ï¤³¤ÎÀ©¸Â¤Þ¤Ç¤Î¥Ð¥¤¥È¤ò¥í¥Ã¥¯¤Ç¤­¤ë¡£
388 ¤³¤ÎÀ©¸Â¤Ë¤Ï 2 ¤Ä¤Î¼ïÎब¤¢¤ë¡£
389 .\"O In Linux kernels before 2.6.9, this limit controlled the amount of
390 .\"O memory that could be locked by a privileged process.
391 2.6.9 ¤è¤êÁ°¤Î Linux ¥«¡¼¥Í¥ë ¤Ç¤Ï¡¢
392 ¤³¤ÎÀ©¸Â¤ÏÆø¢¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤ë¥á¥â¥ê¤Î¹ç·×¤òÀ©¸æ¤·¤Æ¤¤¤¿¡£
393 .\"O Since Linux 2.6.9, no limits are placed on the amount of memory
394 .\"O that a privileged process may lock, and this limit instead governs
395 .\"O the amount of memory that an unprivileged process may lock.
396 Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢Æø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤ËÀ©¸Â¤Ï¤Ê¤¯¡¢
397 Âå¤ï¤ê¤Ë¤³¤ÎÀ©¸Â¤ÏÈóÆø¢¥×¥í¥»¥¹¤¬¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤Ë
398 ŬÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
399 .TP
400 .\"O .BR RLIMIT_MSGQUEUE " (Since Linux 2.6.8)"
401 .BR RLIMIT_MSGQUEUE " (Linux 2.6.8 °Ê¹ß)"
402 .\"O Specifies the limit on the number of bytes that can be allocated
403 .\"O for POSIX message queues for the real user ID of the calling process.
404 .\"O This limit is enforced for
405 .\"O .BR mq_open (3).
406 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ¡¢
407 POSIX ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¤¿¤á¤Ë³ÎÊݤǤ­¤ë¥Ð¥¤¥È¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£
408 ¤³¤ÎÀ©¸Â¤Ï
409 .BR mq_open (3)
410 ¤ËÂФ·¤ÆŬÍѤµ¤ì¤ë¡£
411 .\"O Each message queue that the user creates counts (until it is removed)
412 .\"O against this limit according to the formula:
413 ¥æ¡¼¥¶¤¬ºîÀ®¤·¤¿³Æ¡¹¤Î¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î¥Ð¥¤¥È¿ô¤Ï
414 °Ê²¼¤Î¼°¤Ë¤è¤ê·×»»¤µ¤ì¡¢(¤½¤Î¥­¥å¡¼¤¬ºï½ü¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö)
415 ¤³¤ÎÀ©¸Â¤Î·×»»Âоݤ˴ޤá¤é¤ì¤ë¡£
416 .nf
417
418     bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) +
419             attr.mq_maxmsg * attr.mq_msgsize
420
421 .fi
422 .\"O where
423 .\"O .I attr
424 .\"O is the
425 .\"O .I mq_attr
426 .\"O structure specified as the fourth argument to
427 .\"O .BR mq_open (3).
428 ¤³¤³¤Ç
429 .I attr
430 ¤Ï
431 .I mq_attr
432 ¹½Â¤ÂΤǤ¢¤ê¡¢
433 .BR mq_open (3)
434 ¤ÎÂè 4 °ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤ë¡£
435
436 .\"O The first addend in the formula, which includes
437 .\"O .I "sizeof(struct msg_msg *)"
438 .\"O (4 bytes on Linux/i386), ensures that the user cannot
439 .\"O create an unlimited number of zero-length messages (such messages
440 .\"O nevertheless each consume some system memory for bookkeeping overhead).
441 .I "sizeof(struct msg_msg *)"
442 (Linux/i386 ¤Ç¤Ï 4 ¥Ð¥¤¥È) ¤ò´Þ¤àºÇ½é¤Î²Ã¿ô¤Ï¡¢
443 ¥æ¡¼¥¶¡¼¤¬Ä¹¤µ 0 ¤Î¥á¥Ã¥»¡¼¥¸¤ò̵À©¸Â¤Ëºî¤ì¤Ê¤¤¤³¤ÈÊݾڤ·¤Æ¤¤¤ë
444 (¤³¤Î¤è¤¦¤Ê¥á¥Ã¥»¡¼¥¸¤Ç¤¢¤Ã¤Æ¤â¡¢
445 µ­Ï¿¤Î¤¿¤á¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ç¥·¥¹¥Æ¥à¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë)¡£
446 .TP
447 .\"O .BR RLIMIT_NICE " (since Linux 2.6.12, but see BUGS below)"
448 .BR RLIMIT_NICE " (Linux 2.6.12 °Ê¹ß, ²¼µ­¤Î¡Ö¥Ð¥°¡×¤ÎÀá¤â»²¾È)"
449 .\"O Specifies a ceiling to which the process's nice value can be raised using
450 .\"O .BR setpriority (2)
451 .\"O or
452 .\"O .BR nice (2).
453 .\"O The actual ceiling for the nice value is calculated as
454 .\"O .IR "20\ \-\ rlim_cur" .
455 .\"O (This strangeness occurs because negative numbers cannot be specified
456 .\"O as resource limit values, since they typically have special meanings.
457 .\"O For example,
458 .\"O .B RLIM_INFINITY
459 .\"O typically is the same as \-1.)
460 .BR setpriority (2)
461 ¤ä
462 .BR nice (2)
463 ¤ò»È¤Ã¤Æ°ú¤­¾å¤²¤é¤ì¤ë¥×¥í¥»¥¹¤Î nice Ãͤξå¸Â¤ò»ØÄꤹ¤ë¡£
464 nice Ãͤμºݤξå¸Â¤Ï
465 .I "20\ \-\ rlim_cur"
466 ¤Ç·×»»¤µ¤ì¤ë
467 (¤³¤Î¤è¤¦¤ÊÊѤʾõ¶·¤Ï¡¢¥ê¥½¡¼¥¹À©¸ÂÃͤȤ·¤ÆÉé¤Î¿ô¤ò»ØÄê¤Ç¤­¤Ê¤¤¤¿¤á
468 ȯÀ¸¤¹¤ë¡£Ä̾Éé¤ÎÃͤÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£
469 Î㤨¤Ð¡¢Ä̾ï¤Ï
470 .B RLIM_INFINITY
471 ¤ÎÃͤϠ\-1 ¤Ç¤¢¤ë)¡£
472 .TP
473 .B RLIMIT_NOFILE
474 .\"O Specifies a value one greater than the maximum file descriptor number
475 .\"O that can be opened by this process.
476 ¤³¤Î¥×¥í¥»¥¹¤¬¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤ÎºÇÂçÃͤè¤ê
477 1 Â礭¤¤Ãͤò»ØÄꤹ¤ë¡£
478 .\"O Attempts
479 .\"O .RB ( open (2),
480 .\"O .BR pipe (2),
481 .\"O .BR dup (2),
482 .\"O etc.)
483 .\"O to exceed this limit yield the error
484 .\"O .BR EMFILE .
485 .\"O (Historically, this limit was named
486 .\"O .B RLIMIT_OFILE
487 .\"O on BSD.)
488 .RB ( open (2),
489 .BR pipe (2),
490 .BR dup (2)
491 ¤Ê¤É¤Ë¤è¤ê) ¤³¤Î¾å¸Â¤òĶ¤¨¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼
492 .B EMFILE
493 ¤¬È¯À¸¤¹¤ë
494 (Îò»ËŪ¤Ë¡¢BSD ¤Ç¤Ï¤³¤Î¾å¸Â¤Ï
495 .B RLIMIT_OFILE
496 ¤È¤¤¤¦Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤ë)¡£
497 .TP
498 .B RLIMIT_NPROC
499 .\"O The maximum number of processes (or, more precisely on Linux, threads)
500 .\"O that can be created for the real user ID of the calling process.
501 .\"O Upon encountering this limit,
502 .\"O .BR fork (2)
503 .\"O fails with the error
504 .\"O .BR EAGAIN .
505 ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ÇºîÀ®¤Ç¤­¤ëºÇÂç¥×¥í¥»¥¹¿ô
506 (¤è¤êÀµ³Î¤Ë¤Ï Linux ¤Ç¤Ï¥¹¥ì¥Ã¥É¿ô)¡£
507 ¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢
508 .BR fork (2)
509 ¤Ï¥¨¥é¡¼
510 .B EAGAIN
511 ¤Ç¼ºÇÔ¤¹¤ë¡£
512 .TP
513 .B RLIMIT_RSS
514 .\"O Specifies the limit (in pages) of the process's resident set
515 .\"O (the number of virtual pages resident in RAM).
516 ¥×¥í¥»¥¹¤Î resident set (RAM ¾å¤Ë¸ºß¤¹¤ë²¾ÁÛ¥Ú¡¼¥¸¤Î¿ô) ¤Î
517 ¾å¸Â¤ò (¥Ú¡¼¥¸¿ô¤Ç) »ØÄꤹ¤ë¡£
518 .\"O This limit only has effect in Linux 2.4.x, x < 30, and there only
519 .\"O affects calls to
520 .\"O .BR madvise (2)
521 .\"O specifying
522 .\"O .BR MADV_WILLNEED .
523 ¤³¤ÎÀ©¸Â¤Ï 2.4.30 ¤è¤êÁ°¤Ç¤·¤«±Æ¶Á¤¬¤Ê¤¯¡¢
524 .BR madvise (2)
525 ¤Ë
526 .B MADV_WILLNEED
527 ¤ò»ØÄꤷ¤¿´Ø¿ô¥³¡¼¥ë¤Ë¤·¤«±Æ¶Á¤·¤Ê¤¤¡£
528 .\"O .\" As at kernel 2.6.12, this limit still does nothing in 2.6 though
529 .\"O .\" talk of making it do something has surfaced from time to time in LKML
530 .\" ¥«¡¼¥Í¥ë 2.6.12 ¤Î»þÅÀ¤Ç¤Ï¡¢
531 .\" ¤³¤ÎÀ©¸Â¤Ï¥«¡¼¥Í¥ë 2.6 ¤Ç¤Ï¤Þ¤À²¿¤â¹Ô¤ï¤Ê¤¤¡£
532 .\" ¤·¤«¤·¡¢²¿¤ò¤µ¤»¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï LKML ¤Ç»þ¡¹ÏÃÂê¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
533 .\"       -- MTK, Jul 05
534 .TP
535 .\"O .BR RLIMIT_RTPRIO " (Since Linux 2.6.12, but see BUGS)"
536 .BR RLIMIT_RTPRIO " (Linux 2.6.12 °Ê¹ß, ¥Ð¥°¤ÎÀá¤â»²¾È)"
537 .\"O Specifies a ceiling on the real-time priority that may be set for
538 .\"O this process using
539 .\"O .BR sched_setscheduler (2)
540 .\"O and
541 .\"O .BR sched_setparam (2).
542 .BR sched_setscheduler (2)
543 ¤ä
544 .BR sched_setparam (2)
545 ¤ò»È¤Ã¤ÆÀßÄê¤Ç¤­¤ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅ٤ξå¸Â¤ò»ØÄꤹ¤ë¡£
546 .TP
547 .\"O .BR RLIMIT_RTTIME " (Since Linux 2.6.25)"
548 .BR RLIMIT_RTTIME " (Linux 2.6.25 °Ê¹ß)"
549 .\"O Specifies a limit on the amount of CPU time that a process scheduled
550 .\"O under a real-time scheduling policy may consume without making a blocking
551 .\"O system call.
552 .\"O For the purpose of this limit,
553 .\"O each time a process makes a blocking system call,
554 .\"O the count of its consumed CPU time is reset to zero.
555 .\"O The CPU time count is not reset if the process continues trying to
556 .\"O use the CPU but is preempted, its time slice expires, or it calls
557 .\"O .BR sched_yield (2).
558 ¥ê¥¢¥ë¥¿¥¤¥à¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë¤Ç¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤ë¥×¥í¥»¥¹¤¬
559 ¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¾ÃÈñ¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë
560 CPU »þ´Ö¤Î¹ç·×¤Ë¤Ä¤¤¤Æ¤Î¾å¸Â¤ò»ØÄꤹ¤ë¡£
561 ¤³¤Î¾å¸Â¤ÎÌÜŪ¤Î¤¿¤á¡¢¥×¥í¥»¥¹¤¬¥Ö¥í¥Ã¥­¥ó¥°·¿¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò
562 ¸Æ¤Ó½Ð¤¹Å٤ˡ¢¾ÃÈñ¤µ¤ì¤¿ CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£
563 ¥×¥í¥»¥¹¤¬ CPU ¤ò»È¤¤Â³¤±¤è¤¦¤È¤·¤¿¤¬Â¾¤Î¥×¥í¥»¥¹¤ËÃÖ¤­´¹¤¨¤é¤ì¤¿
564 (preempted) ¾ì¹ç¤ä¡¢¤½¤Î¥×¥í¥»¥¹¤Î¥¿¥¤¥à¥¹¥é¥¤¥¹¤¬Ëþλ¤·¤¿¾ì¹ç¡¢
565 ¤½¤Î¥×¥í¥»¥¹¤¬
566 .BR sched_yield (2)
567 ¤ò¸Æ¤Ó½Ð¤·¤¿¾ì¹ç¤Ï¡¢CPU »þ´Ö¤Î¥«¥¦¥ó¥È¤Ï¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¡£
568
569 .\"O Upon reaching the soft limit, the process is sent a
570 .\"O .B SIGXCPU
571 .\"O signal.
572 .\"O If the process catches or ignores this signal and
573 .\"O continues consuming CPU time, then
574 .\"O .B SIGXCPU
575 .\"O will be generated once each second until the hard limit is reached,
576 .\"O at which point the process is sent a
577 .\"O .B SIGKILL
578 .\"O signal.
579 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë
580 .B SIGXCPU
581 ¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£¤½¤Î¥×¥í¥»¥¹¤¬¤³¤Î¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤«
582 ̵»ë¤·¤Æ¡¢CPU »þ´Ö¤ò¾ÃÈñ¤·Â³¤±¤¿¾ì¹ç¤Ë¤Ï¡¢
583 ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤹¤ë¤Þ¤Ç 1 Éäˠ1 ²ó
584 .B SIGXCPU
585 ¤¬À¸À®¤µ¤ì³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£
586 ¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤Ë㤷¤¿»þÅÀ¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï
587 .B SIGKILL
588 ¥·¥°¥Ê¥ë¤¬Á÷¤é¤ì¤ë¡£
589
590 .\"O The intended use of this limit is to stop a runaway
591 .\"O real-time process from locking up the system.
592 ¤³¤Î¾å¸Â¤ò°Õ¿ÞŪ¤Ë»ÈÍѤ¹¤ë¤Î¤Ï¡¢Ë½Áö¤·¤¿¥ê¥¢¥ë¥¿¥¤¥à¡¦¥×¥í¥»¥¹¤ò
593 Ää»ß¤·¤Æ¡¢¥·¥¹¥Æ¥à¤¬Æ°¤«¤Ê¤¯¤Ê¤ë¤Î¤òÈò¤±¤ë¾ì¹ç¤Ç¤¢¤ë¡£
594 .TP
595 .\"O .BR RLIMIT_SIGPENDING " (Since Linux 2.6.8)"
596 .BR RLIMIT_SIGPENDING " (Linux 2.6.8 °Ê¹ß)"
597 .\"O Specifies the limit on the number of signals
598 .\"O that may be queued for the real user ID of the calling process.
599 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤ËÂФ·¤Æ
600 ¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤ë¥·¥°¥Ê¥ë¤Î¿ô¤ÎÀ©¸Â¤ò»ØÄꤹ¤ë¡£
601 .\"O Both standard and real-time signals are counted for the purpose of
602 .\"O checking this limit.
603 ¤³¤ÎÀ©¸Â¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¡¢
604 ɸ½à¥·¥°¥Ê¥ë¤È¥ê¥¢¥ë¥¿¥¤¥à¡¦¥·¥°¥Ê¥ë¤ÎξÊý¤¬¥«¥¦¥ó¥È¤µ¤ì¤ë¡£
605 .\"O However, the limit is only enforced for
606 .\"O .BR sigqueue (2);
607 .\"O it is always possible to use
608 .\"O .BR kill (2)
609 .\"O to queue one instance of any of the signals that are not already
610 .\"O queued to the process.
611 ¤·¤«¤·¡¢¤³¤ÎÀ©¸Â¤Ï
612 .BR sigqueue (2)
613 ¤ËÂФ·¤Æ¤·¤«¶¯À©¤µ¤ì¤º¡¢
614 .BR kill (2)
615 »È¤¦¤³¤È¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤ËÂФ·¤Æ¤Þ¤À¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤Æ¤¤¤Ê¤¤
616 ¥·¥°¥Ê¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
617 .\"O .\" This replaces the /proc/sys/kernel/rtsig-max system-wide limit
618 .\"O .\" that was present in kernels <= 2.6.7.  MTK Dec 04
619 .\" ¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.7 °ÊÁ°¤Ë¸ºß¤¹¤ë¥·¥¹¥Æ¥àÁ´ÂΤÎÀ©¸Â
620 .\" /proc/sys/kernel/rtsig-max ¤òÃÖ¤­´¹¤¨¤ë¡£MTK Dec 04
621 .TP
622 .B RLIMIT_STACK
623 .\"O The maximum size of the process stack, in bytes.
624 ¥×¥í¥»¥¹¡¦¥¹¥¿¥Ã¥¯¤ÎºÇÂ祵¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤Ç»ØÄꤹ¤ë¡£
625 .\"O Upon reaching this limit, a
626 .\"O .B SIGSEGV
627 .\"O signal is generated.
628 ¤³¤Î¾å¸Â¤Ë㤹¤ë¤È¡¢
629 .B SIGSEGV
630 ¥·¥°¥Ê¥ë¤¬À¸À®¤µ¤ì¤ë¡£
631 .\"O To handle this signal, a process must employ an alternate signal stack
632 .\"O .RB ( sigaltstack (2)).
633 ¤³¤Î¥·¥°¥Ê¥ë¤ò°·¤¦¤¿¤á¤Ë¤Ï¡¢
634 ¥×¥í¥»¥¹¤ÏÂå¤ê¤Î¥·¥°¥Ê¥ë¥¹¥¿¥Ã¥¯
635 .RB ( sigaltstack (2))
636 ¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
637
638 .\"O Since Linux 2.6.23,
639 .\"O this limit also determines the amount of space used for the process's
640 .\"O command-line arguments and environment variables; for details, see
641 .\"O .BR execve (2).
642 Linux 2.6.23 °Ê¹ß¤Ç¤Ï¡¢¤³¤ÎÀ©¸Â¤Ï¥×¥í¥»¥¹¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤È´Ä¶­ÊÑ¿ô
643 ¤Ë»ÈÍѤµ¤ì¤ë¶õ´Ö¤Î¹ç·×¥µ¥¤¥º¤Î¾å¸Â¤Î·èÄê¤Ë¤â»ÈÍѤµ¤ì¤ë¡£¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
644 .BR execve (2)
645 ¤ò»²¾È¡£
646 .\"O .SH "RETURN VALUE"
647 .SH ÊÖ¤êÃÍ
648 .\"O On success, zero is returned.
649 .\"O On error, \-1 is returned, and
650 .\"O .I errno
651 .\"O is set appropriately.
652 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
653 .I errno
654 ¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£
655 .\"O .SH ERRORS
656 .SH ¥¨¥é¡¼
657 .TP
658 .B EFAULT
659 .\"O .I rlim
660 .\"O points outside the accessible address space.
661 .I rlim
662 ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
663 .TP
664 .B EINVAL
665 .\"O .I resource
666 .\"O is not valid;
667 .\"O or, for
668 .\"O .BR setrlimit ():
669 .\"O .I rlim\->rlim_cur
670 .\"O was greater than
671 .\"O .IR rlim\->rlim_max .
672 .I resource
673 ¤¬Í­¸ú¤Ç¤Ê¤¤¡£
674 ¤Þ¤¿¤Ï¡¢
675 .BR setrlimit ()
676 ¤Ç¡¢
677 .I rlim\->rlim_cur
678 ¤¬
679 .I rlim\->rlim_max
680 ¤è¤ê¤âÂ礭¤«¤Ã¤¿¡£
681 .TP
682 .B EPERM
683 .\"O An unprivileged process tried to use
684 .\"O .BR setrlimit ()
685 .\"O to
686 .\"O increase a soft or hard limit above the current hard limit; the
687 .\"O .B CAP_SYS_RESOURCE
688 .\"O capability is required to do this.
689 Æø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬
690 .BR setrlimit ()
691 ¤ò»ÈÍѤ·¤Æ
692 ¥½¥Õ¥È¡¦¥ê¥ß¥Ã¥È¤Þ¤¿¤Ï¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤ò
693 ¸½ºß¤Î¥Ï¡¼¥É¡¦¥ê¥ß¥Ã¥È¤è¤êÂ礭¤¯¤·¤è¤¦¤È»î¤ß¤¿¡£
694 ¤³¤ì¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï
695 .B CAP_SYS_RESOURCE
696 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£
697 .\"O Or, the process tried to use
698 .\"O .BR setrlimit ()
699 .\"O to increase
700 .\"O the soft or hard
701 .\"O .B RLIMIT_NOFILE
702 .\"O limit above the current kernel
703 .\"O maximum
704 .\"O .RB ( NR_OPEN ).
705 ¤Þ¤¿¤ÏÆø¢¤Î¤Ê¤¤¥×¥í¥»¥¹¤¬
706 .BR setrlimit ()
707 ¤ò»ÈÍѤ·¤Æ
708 ¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É
709 .B RLIMIT_NOFILE
710 ¥ê¥ß¥Ã¥È¤ò¸½ºß¤Î¥«¡¼¥Í¥ë¤ÎºÇÂçÃÍ
711 .RB ( NR_OPEN )
712 °Ê¾å¤ËÁý²Ã¤µ¤»¤è¤¦¤È¤·¤¿¡£
713 .\"O .SH CONFORMING TO
714 .SH ½àµò
715 SVr4, 4.3BSD, POSIX.1-2001.
716 .\"O .B RLIMIT_MEMLOCK
717 .\"O and
718 .\"O .B RLIMIT_NPROC
719 .\"O derive from BSD and are not specified in POSIX.1-2001;
720 .\"O they are present on the BSDs and Linux, but on few other implementations.
721 .B RLIMIT_MEMLOCK
722 ¤È
723 .B RLIMIT_NPROC
724 ¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
725 ¤³¤ì¤é¤Ï BSD ·Ï¤È Linux ¤Ë¸ºß¤¹¤ë¤¬¡¢Â¾¤Î¼ÂÁõ¤Ï¾¯¤Ê¤¤¡£
726 .\"O .B RLIMIT_RSS
727 .\"O derives from BSD and is not specified in POSIX.1-2001;
728 .\"O it is nevertheless present on most implementations.
729 .R RLIMIT_RSS
730 ¤Ï BSD ¤«¤éÇÉÀ¸¤·¡¢POSIX.1-2001 ¤Ë¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
731 ¤½¤ì¤Ë¤â´Ø¤ï¤é¤ºÂ¿¤¯¤Î¼ÂÁõ¤Ç¸ºß¤¹¤ë¡£
732 .\"O .BR RLIMIT_MSGQUEUE ,
733 .\"O .BR RLIMIT_NICE ,
734 .\"O .BR RLIMIT_RTPRIO ,
735 .\"O .BR RLIMIT_RTTIME ,
736 .\"O and
737 .\"O .B RLIMIT_SIGPENDING
738 .\"O are Linux-specific.
739 .BR RLIMIT_MSGQUEUE ,
740 .BR RLIMIT_NICE ,
741 .BR RLIMIT_RTPRIO ,
742 .BR RLIMIT_RTTIME ,
743 .B RLIMIT_SIGPENDING
744 ¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£
745 .\"O .SH NOTES
746 .SH Ãí°Õ
747 .\"O A child process created via
748 .\"O .BR fork (2)
749 .\"O inherits its parent's resource limits.
750 .\"O Resource limits are preserved across
751 .\"O .BR execve (2).
752 .BR fork (2)
753 ¤ÇºîÀ®¤µ¤ì¤¿ºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢
754 ¿Æ¥×¥í¥»¥¹¤Î¥ê¥½¡¼¥¹À©¸Â¤ò·Ñ¾µ¤¹¤ë¡£
755 .BR execve (2)
756 ¤ÎÁ°¸å¤Ç¥ê¥½¡¼¥¹À©¸Â¤ÏÊݸ¤µ¤ì¤ë¡£
757
758 .\"O One can set the resource limits of the shell using the built-in
759 .\"O .IR ulimit
760 .\"O command
761 .\"O .RI ( limit
762 .\"O in
763 .\"O .BR csh (1)).
764 .\"O The shell's resource limits are inherited by the processes that
765 .\"O it creates to execute commands.
766 ¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥·¥§¥ë¤ÎÁȤ߹þ¤ß¥³¥Þ¥ó¥É¤Ç¤¢¤ë
767 .I ulimit
768 .RB ( csh (1)
769 ¤Ç¤Ï
770 .I limit )
771 ¤ò»È¤Ã¤ÆÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
772 ¤³¤Î¥·¥§¥ë¤Î¥ê¥½¡¼¥¹À©¸Â¤Ï¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¥·¥§¥ë¤¬À¸À®¤¹¤ë¥×¥í¥»¥¹
773 ¤Ë°ú¤­·Ñ¤¬¤ì¤ë¡£
774 .\"O .SH BUGS
775 .SH ¥Ð¥°
776 .\"O In older Linux kernels, the
777 .\"O .B SIGXCPU
778 .\"O and
779 .\"O .B SIGKILL
780 .\"O signals delivered when a process encountered the soft and hard
781 .\"O .B RLIMIT_CPU
782 .\"O limits were delivered one (CPU) second later than they should have been.
783 °ÊÁ°¤Î Linux ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥×¥í¥»¥¹¤¬¥½¥Õ¥È¤Þ¤¿¤Ï¥Ï¡¼¥É
784 .B RLIMIT_CPU
785 ¥ê¥ß¥Ã¥È¤Ë㤷¤¿¾ì¹ç¤ËÁ÷¤é¤ì¤ë
786 .B SIGXCPU
787 ¤È
788 .B SIGKILL
789 ¥·¥°¥Ê¥ë¤¬¡¢ËÜÍèÁ÷¤é¤ì¤ë¤Ù¤­»þÅÀ¤Î 1 (CPU) Éøå¤ËÁ÷¤é¤ì¤Æ¤·¤Þ¤¦¡£
790 .\"O This was fixed in kernel 2.6.8.
791 ¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.8 ¤Ç½¤Àµ¤µ¤ì¤¿¡£
792
793 .\"O In 2.6.x kernels before 2.6.17, a
794 .\"O .B RLIMIT_CPU
795 .\"O limit of 0 is wrongly treated as "no limit" (like
796 .\"O .BR RLIM_INFINITY ).
797 .\"O Since Linux 2.6.17, setting a limit of 0 does have an effect,
798 .\"O but is actually treated as a limit of 1 second.
799 2.6.17 ¤è¤êÁ°¤Î 2.6.x ¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
800 .B RLIMIT_CPU
801 ¥ê¥ß¥Ã¥È¤¬ 0 ¤Î¾ì¹ç¡¢
802 .RB ( RLIM_INFINITY
803 ¤ÈƱ¤¸¤è¤¦¤Ë) ¡ÖÀ©¸Â¤Ê¤·¡×¤È´Ö°ã¤Ã¤Æ²ò¼á¤µ¤ì¤Æ¤¤¤¿¡£
804 Linux 2.6.17 °Ê¹ß¤Ç¤Ï¡¢¥ê¥ß¥Ã¥È¤ò 0 ¤ËÀßÄꤷ¤¿¾ì¹ç¤Ë¤â
805 ¸ú²Ì¤ò»ý¤Ä¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Ë¤Ï¥ê¥ß¥Ã¥È¤ÎÃͤϠ1 ÉäȤʤ롣
806 .\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2
807
808 .\"O A kernel bug means that
809 .\"O .B RLIMIT_RTPRIO
810 .\"O does not work in kernel 2.6.12; the problem is fixed in kernel 2.6.13.
811 ¥«¡¼¥Í¥ë 2.6.12 ¤Ë¤Ï¡¢
812 .B RLIMIT_RTPRIO
813 ¤¬Æ°ºî¤·¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ë¡£¤³¤ÎÌäÂê¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤ë¡£
814
815 .\"O In kernel 2.6.12, there was an off-by-one mismatch
816 .\"O between the priority ranges returned by
817 .\"O .BR getpriority (2)
818 .\"O and
819 .\"O .BR RLIMIT_NICE .
820 .\"O This had the effect that actual ceiling for the nice value
821 .\"O was calculated as
822 .\"O .IR "19\ \-\ rlim_cur" .
823 .\"O This was fixed in kernel 2.6.13.
824 .\"O .\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
825 ¥«¡¼¥Í¥ë 2.6.12 ¤Ç¤Ï¡¢
826 .BR getpriority (2)
827 ¤È
828 .B RLIMIT_NICE
829 ¤¬ÊÖ¤¹Í¥ÀèÅÙ¤ÎÈϰϤ¬°ì¤Ä¤º¤ì¤Æ¤¤¤¿¡£¤³¤Î¤¿¤á¡¢nice Ãͤμºݤξå¸Â¤¬
830 .I "19\ \-\ rlim_cur"
831 ¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤È¤¤¤¦±Æ¶Á¤¬¤¢¤Ã¤¿¡£¤³¤ì¤Ï¥«¡¼¥Í¥ë 2.6.13 ¤Ç½¤Àµ¤µ¤ì¤¿¡£
832 .\" »²¹Í: http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
833
834 .\"O Kernels before 2.4.22 did not diagnose the error
835 .\"O .B EINVAL
836 .\"O for
837 .\"O .BR setrlimit ()
838 .\"O when
839 .\"O .I rlim\->rlim_cur
840 .\"O was greater than
841 .\"O .IR rlim\->rlim_max .
842 2.4.22 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
843 .I rlim\->rlim_cur
844 ¤¬
845 .I rlim\->rlim_max
846 ¤è¤êÂ礭¤«¤Ã¤¿¾ì¹ç¡¢
847 .BR setrlimit ()
848 ¤Ç¤Î
849 .B EINVAL
850 ¥¨¥é¡¼¤ò¸¡½Ð¤Ç¤­¤Ê¤¤¡£
851 .\"O .SH "SEE ALSO"
852 .SH ´ØÏ¢¹àÌÜ
853 .BR dup (2),
854 .BR fcntl (2),
855 .BR fork (2),
856 .BR getrusage (2),
857 .BR mlock (2),
858 .BR mmap (2),
859 .BR open (2),
860 .BR quotactl (2),
861 .BR sbrk (2),
862 .BR shmctl (2),
863 .BR sigqueue (2),
864 .BR malloc (3),
865 .BR ulimit (3),
866 .BR core (5),
867 .BR capabilities (7),
868 .BR signal (7)