OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / remap_file_pages.2
1 .\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" 2003-12-10 Initial creation, Michael Kerrisk <mtk.manpages@gmail.com>
24 .\" 2004-10-28 aeb, corrected prototype, prot must be 0
25 .\"
26 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
27 .\"         all rights reserved.
28 .\" Translated Thu Jun 24 06:00:37 JST 2004
29 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
30 .\" Updated & Modified Mon Jan  3 02:50:11 JST 2005 by Yuichi SATO
31 .\" Updated & Modified Mon Oct 10 01:15:38 JST 2005
32 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
33 .\"
34 .TH REMAP_FILE_PAGES 2 2008-04-22 "Linux" "Linux Programmer's Manual"
35 .\"O .SH NAME
36 .SH 名前
37 .\"O remap_file_pages \- create a nonlinear file mapping
38 remap_file_pages \- 非線形ファイルマッピングを作成する。
39 .\"O .SH SYNOPSIS
40 .SH 書式
41 .nf
42 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
43 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
44 .B #include <sys/mman.h>
45 .sp
46 .BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot ,
47 .BI "                     ssize_t " pgoff ", int " flags );
48 .fi
49 .\"O .SH DESCRIPTION
50 .SH 説明
51 .\"O The
52 .\"O .BR remap_file_pages ()
53 .\"O system call is used to create a nonlinear mapping, that is, a mapping
54 .\"O in which the pages of the file are mapped into a nonsequential order
55 .\"O in memory.
56 .BR remap_file_pages ()
57 システムコールは非線形なマッピング、
58 つまりファイルのページがメモリ上で連続しない順番でマップされる
59 マッピングを作成するために使われる。
60 .\"O The advantage of using
61 .\"O .BR remap_file_pages ()
62 .\"O over using repeated calls to
63 .\"O .BR mmap (2)
64 .\"O is that the former approach does not require the kernel to create
65 .\"O additional VMA (Virtual Memory Area) data structures.
66 .BR remap_file_pages ()
67 を使う方が
68 .BR mmap (2)
69 を繰り返して使うより優れている点は、
70 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域)
71 データ構造体を追加で作成する必要がないことである。
72
73 .\"O To create a nonlinear mapping we perform the following steps:
74 非線形マッピングを作成するためには、
75 以下のようなステップを実行する:
76 .TP 3
77 1.
78 .\"O Use
79 .\"O .BR mmap (2)
80 .\"O to create a mapping (which is initially linear).
81 .BR mmap (2)
82 を使い、マッピングを作成する (このマッピングは最初は線形である)。
83 .\"O This mapping must be created with the
84 .\"O .B MAP_SHARED
85 .\"O flag.
86 このマッピングは
87 .B MAP_SHARED
88 フラグを指定して作成されなければならない。
89 .TP
90 2.
91 .\"O Use one or more calls to
92 .\"O .BR remap_file_pages ()
93 .\"O to rearrange the correspondence between the pages of the mapping
94 .\"O and the pages of the file.
95 .\"O It is possible to map the same page of a file
96 .\"O into multiple locations within the mapped region.
97 .BR remap_file_pages ()
98 を 1 回以上呼び出して、
99 マッピングのページとファイルのページの対応関係を再構成する。
100 ファイルの同じページをマッピング領域の複数の場所に
101 マップすることが可能である。
102 .LP
103 .\"O The
104 .\"O .I pgoff
105 .\"O and
106 .\"O .I size
107 .\"O arguments specify the region of the file that is to be relocated
108 .\"O within the mapping:
109 .I pgoff
110
111 .I size
112 引き数は、マッピング内で再配置されるファイルの領域を指定する。
113 .\"O .I pgoff
114 .\"O is a file offset in units of the system page size;
115 .I pgoff
116 はファイルオフセットであり、単位はシステムのページサイズである。
117 .\"O .I size
118 .\"O is the length of the region in bytes.
119 .I size
120 は領域の長さであり、単位はバイトである。
121
122 .\"O The
123 .\"O .I addr
124 .\"O argument serves two purposes.
125 .I addr
126 引き数は 2 つの目的で使われる。
127 .\"O First, it identifies the mapping whose pages we want to rearrange.
128 第 1 の目的は、この引き数によって再編成したいページの
129 マッピングを識別することである。
130 .\"O Thus,
131 .\"O .I addr
132 .\"O must be an address that falls within
133 .\"O a region previously mapped by a call to
134 .\"O .BR mmap (2).
135 よって
136 .I addr
137
138 .BR mmap (2)
139 の呼び出しで過去にマップされた領域内のアドレスでなければならない。
140 .\"O Second,
141 .\"O .I addr
142 .\"O specifies the address at which the file pages
143 .\"O identified by
144 .\"O .I pgoff
145 .\"O and
146 .\"O .I size
147 .\"O will be placed.
148 第 2 の目的は、
149 .I pgoff
150
151 .I size
152 で識別されるファイルページが置かれる予定のアドレスを、
153 .I addr
154 によって指定することである。
155
156 .\"O The values specified in
157 .\"O .I addr
158 .\"O and
159 .\"O .I size
160 .\"O should be multiples of the system page size.
161 .\"O If they are not, then the kernel rounds
162 .\"O .I both
163 .\"O values
164 .\"O .I down
165 .\"O to the nearest multiple of the page size.
166 .\"O .\" This rounding is weird, and not consistent with the treatment of
167 .\"O .\" the analogous arguments for munmap()/mprotect() and for mlock().
168 .\"O .\" MTK, 14 Sep 2005
169 .I addr
170
171 .I size
172 に指定する値は、システムのページサイズの倍数とすべきである。
173 それ以外の場合、カーネルは「両方」の値を
174 最も近いページサイズの倍数へ「切り下げる」。
175 .\" この丸め処理は風変わりで、munmap()/mprotect() や mlock() の
176 .\" 同様の引き数の処理方法とも矛盾する。
177 .\" MTK, 14 Sep 2005
178
179 .\"O The
180 .\"O .I prot
181 .\"O argument must be specified as 0.
182 .I prot
183 引き数は 0 に指定されなければならない。
184
185 .\"O The
186 .\"O .I flags
187 .\"O argument has the same meaning as for
188 .\"O .BR mmap (2),
189 .\"O but all flags other than
190 .\"O .B MAP_NONBLOCK
191 .\"O are ignored.
192 .I flags
193 引き数は
194 .BR mmap (2)
195 のものと同じ意味であるが、
196 .B MAP_NONBLOCK
197 以外の全てのフラグは無視される。
198 .\"O .SH "RETURN VALUE"
199 .SH 返り値
200 .\"O On success,
201 .\"O .BR remap_file_pages ()
202 .\"O returns 0.
203 .\"O On error, \-1 is returned, and
204 .\"O .I errno
205 .\"O is set appropriately.
206 成功した場合、
207 .BR remap_file_pages ()
208 は 0 を返す。
209 エラーの場合、\-1 が返され、
210 .I errno
211 が適切に設定される。
212 .\"O .SH ERRORS
213 .SH エラー
214 .TP
215 .B EINVAL
216 .\"O .I addr
217 .\"O does not refer to a valid mapping
218 .\"O created with the
219 .\"O .B MAP_SHARED
220 .\"O flag.
221 .I addr
222
223 .B MAP_SHARED
224 フラグを指定して作成された有効なマッピングを参照していない。
225 .TP
226 .B EINVAL
227 .\"O .IR addr ,
228 .\"O .IR size ,
229 .\"O .IR prot ,
230 .\"O or
231 .\"O .I pgoff
232 .\"O is invalid.
233 .IR addr ,
234 .IR size ,
235 .IR prot ,
236 .I pgoff
237 のいずれかが不正である。
238 .\"O .\" And possibly others from vma->vm_ops->populate()
239 .\"Osato:
240 .\"Osato: others が何を指すのかよく分からない。
241 .\"Osato:
242 .\" または vma->vm_ops->populate() からの他のエラーかもしれない。
243 .\"O .SH VERSIONS
244 .SH バージョン
245 .\"O The
246 .\"O .BR remap_file_pages ()
247 .\"O system call appeared in Linux 2.5.46;
248 .\"O glibc support was added in version 2.3.3.
249 .BR remap_file_pages ()
250 システムコールは Linux 2.5.46 で登場した。
251 glibc でのサポートは glibc バージョン 2.3.3 で追加された。
252 .\"O .SH "CONFORMING TO"
253 .SH 準拠
254 .\"O The
255 .\"O .BR remap_file_pages ()
256 .\"O system call is Linux-specific.
257 .BR remap_file_pages ()
258 システムコールは Linux 固有のものである。
259 .\"O .SH "SEE ALSO"
260 .SH 関連項目
261 .BR getpagesize (2),
262 .BR mmap (2),
263 .BR mmap2 (2),
264 .BR mprotect (2),
265 .BR mremap (2),
266 .BR msync (2)