OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / mincore.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 2001 Bert Hubert <ahu@ds9a.nl>
4 .\" and Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
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 .\" Created Sun Jun 3 17:23:32 2001 by bert hubert <ahu@ds9a.nl>
27 .\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04.
28 .\" Modified, 20 May 2003, Michael Kerrisk <mtk.manpages@gmail.com>
29 .\" Modified, 30 Apr 2004, Michael Kerrisk <mtk.manpages@gmail.com>
30 .\" 2005-04-05 mtk, Fixed error descriptions
31 .\"     after message from <gordon.jin@intel.com>
32 .\" 2007-01-08 mtk, rewrote various parts
33 .\"
34 .\" Japanese Version Copyright (c) 2001-2005 Yuichi SATO
35 .\"         all rights reserved.
36 .\" Translated Sun Jul  8 21:09:35 JST 2001
37 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
38 .\" Updated & Modified Sat Jul 26 13:54:03 JST 2003
39 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
40 .\" Updated & Modified Fri Dec 31 05:59:40 JST 2004 by Yuichi SATO
41 .\" Updated & Modified Fri Apr 22 02:35:03 JST 2005 by Yuichi SATO
42 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.44
43 .\"
44 .\"WORD:        least significant bit   ºÇ²¼°Ì¥Ó¥Ã¥È
45 .\"
46 .TH MINCORE 2 2008-04-22 "Linux" "Linux Programmer's Manual"
47 .\"O .SH NAME
48 .SH Ì¾Á°
49 .\"O mincore \- determine whether pages are resident in memory
50 mincore \- ¥Ú¡¼¥¸¤¬¥á¥â¥êÆâ¤Ë¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë
51 .\"O .SH SYNOPSIS
52 .SH ½ñ¼°
53 .B #include <unistd.h>
54 .br
55 .B #include <sys/mman.h>
56 .sp
57 .BI "int mincore(void *" addr ", size_t " length ", unsigned char *" vec );
58 .sp
59 .in -4n
60 .\"O Feature Test Macro Requirements for glibc (see
61 .\"O .BR feature_test_macros (7)):
62 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
63 .RB ( feature_test_macros (7)
64 »²¾È):
65 .in
66 .sp
67 .BR mincore ():
68 _BSD_SOURCE || _SVID_SOURCE
69 .\"O .SH DESCRIPTION
70 .SH ÀâÌÀ
71 .\"O .BR mincore ()
72 .\"O returns a vector that indicates whether pages
73 .\"O of the calling process's virtual memory are resident in core (RAM),
74 .\"O and so will not cause a disk access (page fault) if referenced.
75 .\"O The kernel returns residency information about the pages
76 .\"O starting at the address
77 .\"O .IR addr ,
78 .\"O and continuing for
79 .\"O .I length
80 .\"O bytes.
81 .BR mincore ()
82 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î²¾ÁÛ¥á¥â¥ê¤Î¥Ú¡¼¥¸¤¬¥³¥¢ (RAM) Æâ¤Ë¸ºß¤·¡¢
83 ¥Ú¡¼¥¸»²¾È»þ¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹ (¥Ú¡¼¥¸¡¦¥Õ¥©¡¼¥ë¥È) ¤òµ¯¤³¤µ¤Ê¤¤¤«
84 ¤É¤¦¤«¤ò¼¨¤¹¥Ù¥¯¥È¥ë¤òÊÖ¤¹¡£¥«¡¼¥Í¥ë¤Ï¡¢¥¢¥É¥ì¥¹
85 .I addr
86 ¤«¤é»Ï¤Þ¤ë
87 .I length
88 ¥Ð¥¤¥È¤ÎÈϰϤΥڡ¼¥¸¤Ë´Ø¤¹¤ë¸ºß¾ðÊó¤òÊÖ¤¹¡£
89
90 .\"O The
91 .\"O .I addr
92 .\"O argument must be a multiple of the system page size.
93 .\"O The
94 .\"O .I length
95 .\"O argument need not be a multiple of the page size,
96 .\"O but since residency information is returned for whole pages,
97 .\"O .I length
98 .\"O is effectively rounded up to the next multiple of the page size.
99 .\"O One may obtain the page size
100 .\"O .RB ( PAGE_SIZE )
101 .\"O using
102 .\"O .IR sysconf(_SC_PAGESIZE) .
103 .I addr
104 °ú¤­¿ô¤Ï¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
105 .I length
106 °ú¤­¿ô¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤¢¤ëɬÍפϤʤ¤¤¬¡¢
107 ¥Ú¡¼¥¸Á´ÂΤ˴ؤ¹¤ë¸ºß¾ðÊó¤¬ÊÖ¤µ¤ì¤ë¤Î¤Ç¡¢»ö¼Â¾å
108 .I length
109 ¤Ï¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
110 ¥Ú¡¼¥¸¥µ¥¤¥º
111 .RB ( PAGE_SIZE )
112 ¤Ï
113 .I sysconf(_SC_PAGESIZE)
114 ¤ò»È¤Ã¤ÆÆþ¼ê¤Ç¤­¤ë¡£
115
116 .\"O The
117 .\"O .I vec
118 .\"O argument must point to an array containing at least
119 .\"O .I "(length+PAGE_SIZE\-1) / PAGE_SIZE"
120 .\"O bytes.
121 .\"O On return,
122 .\"O the least significant bit of each byte will be set if
123 .\"O the corresponding page is currently resident in memory,
124 .\"O and be clear otherwise.
125 .\"O (The settings of the other bits in each byte are undefined;
126 .\"O these bits are reserved for possible later use.)
127 .I vec
128 °ú¤­¿ô¤Ï¡¢¾¯¤Ê¤¯¤È¤â
129 .I "(length+PAGE_SIZE\-1) / PAGE_SIZE"
130 ¥Ð¥¤¥È¤¬³ÊǼ¤Ç¤­¤ëÇÛÎó¤ò»Ø¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
131 ¤³¤Î¸Æ¤Ó½Ð¤·¤¬ÊÖ¤ë¤È¤­¡¢
132 ³Æ¥Ð¥¤¥È¤ÎºÇ²¼°Ì¥Ó¥Ã¥È¤Ï¡¢Âбþ¤¹¤ë¥Ú¡¼¥¸¤¬¥á¥â¥êÆâ¤Ë¤½¤Î¤È¤­Â¸ºß¤¹¤ì¤Ð
133 ¥»¥Ã¥È¤µ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¥¯¥ê¥¢¤µ¤ì¤ë
134 (³Æ¥Ð¥¤¥È¤Î¤½¤Î¾¤Î¥Ó¥Ã¥È¤Ï̤ÄêµÁ¤Ç¤¢¤ê¡¢¤³¤ì¤é¤Î¥Ó¥Ã¥È¤Ï¾­Íè¤Î»ÈÍѤË
135 ¤½¤Ê¤¨¤ÆͽÌ󤵤ì¤Æ¤¤¤ë)¡£
136 .\"O Of course the information returned in
137 .\"O .I vec
138 .\"O is only a snapshot: pages that are not
139 .\"O locked in memory can come and go at any moment, and the contents of
140 .\"O .I vec
141 .\"O may already be stale by the time this call returns.
142 ¤â¤Á¤í¤ó¡¢
143 .I vec
144 ¤ÇÊÖ¤µ¤ì¤¿¾ðÊó¤Ï¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥È¤Ç¤·¤«¤Ê¤¤¡£
145 ¥á¥â¥êÆâ¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï¡¢Ç¤°Õ¤Î»þÅÀ¤Ç¥á¥â¥êÆâ¤Ë
146 Æþ¤Ã¤¿¤ê½Ð¤¿¤ê¤Ç¤­¡¢¤³¤Î¸Æ¤Ó½Ð¤·¤¬ÊÖ¤ë¤È¤­¤Ë¤Ï
147 .I vec
148 ¤ÎÆâÍƤϤ¹¤Ç¤Ë¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
149 .\"O .SH "RETURN VALUE"
150 .SH ÊÖ¤êÃÍ
151 .\"O On success,
152 .\"O .BR mincore ()
153 .\"O returns zero.
154 À®¸ù¤·¤¿¾ì¹ç¡¢
155 .BR mincore ()
156 ¤Ï 0 ¤òÊÖ¤¹¡£
157 .\"O On error, \-1 is returned, and
158 .\"O .I errno
159 .\"O is set appropriately.
160 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¤Æ¡¢
161 .I errno
162 ¤òŬÀÚ¤ÊÃͤËÀßÄꤹ¤ë¡£
163 .\"O .SH ERRORS
164 .SH ¥¨¥é¡¼
165 .B EAGAIN
166 .\"O kernel is temporarily out of resources.
167 ¥«¡¼¥Í¥ë¤¬°ì»þŪ¤Ë¥ê¥½¡¼¥¹¤ò»È¤¤²Ì¤¿¤·¤Æ¤¤¤ë¡£
168 .TP
169 .B EFAULT
170 .\"O .I vec
171 .\"O points to an invalid address.
172 .I vec
173 ¤¬Ìµ¸ú¤Ê¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤ë¡£
174 .TP
175 .B EINVAL
176 .\"O .I addr
177 .\"O is not a multiple of the page size.
178 .I addr
179 ¤¬¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ç¤Ê¤¤¡£
180 .TP
181 .B ENOMEM
182 .\"O .I length
183 .\"O is greater than
184 .\"O .RI ( TASK_SIZE " \- " addr ).
185 .I length
186 ¤¬
187 .RI ( TASK_SIZE " \- " addr )
188 ¤è¤êÂ礭¤¤¡£
189 .\"O (This could occur if a negative value is specified for
190 .\"O .IR length ,
191 .\"O since that value will be interpreted as a large
192 .\"O unsigned integer.)
193 .RI ( length
194 ¤ËÉé¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
195 ¤½¤ÎÃͤ¬Â礭¤ÊÉä¹æ¤Ê¤·À°¿ô¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¤¿¤á¤Ëµ¯¤³¤ë¤³¤È¤¬¤¢¤ë¡£)
196 .\"O In Linux 2.6.11 and earlier, the error
197 .\"O .B EINVAL
198 .\"O was returned for this condition.
199 Linux 2.6.11 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¾ò·ï¤Î¾ì¹ç¤Ï¥¨¥é¡¼
200 .B EINVAL
201 ¤¬ÊÖ¤µ¤ì¤Æ¤¤¤¿¡£
202 .TP
203 .B ENOMEM
204 .\"O .I addr
205 .\"O to
206 .\"O .I addr
207 .\"O +
208 .\"O .I length
209 .\"O contained unmapped memory.
210 .I addr
211 ¤«¤é
212 .I addr
213 +
214 .I length
215 ¤Î´Ö¤Ë¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤Ê¤¤¥á¥â¥ê¤¬¤¢¤Ã¤¿¡£
216 .\"O .SH VERSIONS
217 .\"O Since Linux 2.3.99pre1 and glibc 2.2.
218 .SH ¥Ð¡¼¥¸¥ç¥ó
219 Linux 2.3.99pre1 ¤È glibc 2.2 ¤«¤éÍøÍѲÄǽ¤Ç¤¢¤ë¡£
220 .\"O .SH "CONFORMING TO"
221 .SH ½àµò
222 .\"O .BR mincore ()
223 .\"O is not specified in POSIX.1-2001,
224 .\"O and it is not available on all Unix implementations.
225 .BR mincore ()
226 ¤Ï POSIX.1-2001 ¤Ëµ­½Ò¤µ¤ì¤Æ¤ª¤é¤º¡¢
227 Á´¤Æ¤Î Unix ¼ÂÁõ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
228 .\" It is on at least NetBSD, FreeBSD, OpenBSD, Solaris 8,
229 .\" AIX 5.1, SunOS 4.1
230 .\"O .\" .SH HISTORY
231 .\" .SH Îò»Ë
232 .\"O .\" The
233 .\"O .\" .BR mincore ()
234 .\"O .\" function first appeared in 4.4BSD.
235 .\" .BR mincore ()
236 .\" ´Ø¿ô¤Ï 4.4BSD ¤Ç½é¤á¤ÆÅо줷¤¿¡£
237 .\"O .SH "BUGS"
238 .SH ¥Ð¥°
239 .\"O Before kernel 2.6.21,
240 .\"O .BR mincore ()
241 .\"O did not return correct information for
242 .\"O .B MAP_PRIVATE
243 .\"O mappings, or for nonlinear mappings (established using
244 .\"O .BR remap_file_pages (2)).
245 ¥«¡¼¥Í¥ë 2.6.21 ¤è¤êÁ°¤Ï¡¢
246 .BR mincore ()
247 ¤Ï¡¢
248 .B MAP_PRIVATE
249 ¥Þ¥Ã¥Ô¥ó¥°¤äÈóÀþ·Á¥Þ¥Ã¥Ô¥ó¥°
250 .RB ( remap_file_pages (2)
251 ¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤ë) ¤Ë¤Ä¤¤¤ÆÀµ¤·¤¤¾ðÊó¤òÊÖ¤µ¤Ê¤«¤Ã¤¿¡£
252 .\"O .\" Linux (up to now, 2.6.5),
253 .\"O .\" .B mincore
254 .\"O .\" does not return correct information for MAP_PRIVATE mappings:
255 .\" Linux ¤Ç¤Ï (2.6.5 ¤Î¸½ºß¤Ë»ê¤ë¤Þ¤Ç)¡¢
256 .\" .B mincore
257 .\" ¤Ï MAP_PRIVATE ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¤ÎÀµ¤·¤¤¾ðÊó¤òÊÖ¤µ¤Ê¤¤¡£
258 .\"O .\" for a MAP_PRIVATE file mapping,
259 .\"O .\" .B mincore
260 .\"O .\" returns the residency of the file pages, rather than any
261 .\"O .\" modified process-private pages that have been copied on write;
262 .\" MAP_PRIVATE ¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢
263 .\" .B mincore
264 .\" ¤Ï½ñ¤­¹þ¤ß»þ¥³¥Ô¡¼ (copy on write) ¤µ¤ì¤Æ¤¤¤Æ
265 .\" ½¤Àµ¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥×¥é¥¤¥Ù¡¼¥È¥Ú¡¼¥¸¤òÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
266 .\" ¥Õ¥¡¥¤¥ë¥Ú¡¼¥¸¤¬Â¸ºß¤¹¤ë¤«Èݤ«¤òÊÖ¤¹¡£
267 .\"O .\" for a MAP_PRIVATE mapping of
268 .\"O .\" .IR /dev/zero ,
269 .\"O .\" .B mincore
270 .\"O .\" always reports pages as nonresident;
271 .\" .I /dev/zero
272 .\" ¤Î MAP_PRIVATE ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢
273 .\" .B mincore
274 .\" ¤Ï¾ï¤Ë¥Ú¡¼¥¸¤¬Â¸ºß¤·¤Ê¤¤¤È¤¤¤¦Åú¤¨¤òÊÖ¤¹¡£
275 .\"O .\" and for a MAP_PRIVATE, MAP_ANONYMOUS mapping,
276 .\"O .\" .B mincore
277 .\"O .\" always fails with the error
278 .\"O .\" .BR ENOMEM .
279 .\" MAP_PRIVATE, MAP_ANONYMOUS ¥Þ¥Ã¥Ô¥ó¥°¤Ë¤Ä¤¤¤Æ¡¢
280 .\" .B mincore
281 .\" ¤Ï¾ï¤Ë
282 .\" .B ENOMEM
283 .\" ¤Ç¼ºÇÔ¤¹¤ë¡£
284 .\"O .SH "SEE ALSO"
285 .SH ´ØÏ¢¹àÌÜ
286 .BR mlock (2),
287 .BR mmap (2)