1 .\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" 2003-12-10 Initial creation, Michael Kerrisk <mtk.manpages@gmail.com>
24 .\" 2004-10-28 aeb, corrected prototype, prot must be 0
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>
34 .TH REMAP_FILE_PAGES 2 2008-04-22 "Linux" "Linux Programmer's Manual"
37 .\"O remap_file_pages \- create a nonlinear file mapping
38 remap_file_pages \- 非線形ファイルマッピングを作成する。
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>
46 .BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot ,
47 .BI " ssize_t " pgoff ", int " flags );
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
56 .BR remap_file_pages ()
58 つまりファイルのページがメモリ上で連続しない順番でマップされる
60 .\"O The advantage of using
61 .\"O .BR remap_file_pages ()
62 .\"O over using repeated calls to
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 ()
70 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域)
71 データ構造体を追加で作成する必要がないことである。
73 .\"O To create a nonlinear mapping we perform the following steps:
80 .\"O to create a mapping (which is initially linear).
82 を使い、マッピングを作成する (このマッピングは最初は線形である)。
83 .\"O This mapping must be created with the
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 ()
99 マッピングのページとファイルのページの対応関係を再構成する。
100 ファイルの同じページをマッピング領域の複数の場所に
107 .\"O arguments specify the region of the file that is to be relocated
108 .\"O within the mapping:
112 引き数は、マッピング内で再配置されるファイルの領域を指定する。
114 .\"O is a file offset in units of the system page size;
116 はファイルオフセットであり、単位はシステムのページサイズである。
118 .\"O is the length of the region in bytes.
124 .\"O argument serves two purposes.
127 .\"O First, it identifies the mapping whose pages we want to rearrange.
128 第 1 の目的は、この引き数によって再編成したいページの
132 .\"O must be an address that falls within
133 .\"O a region previously mapped by a call to
139 の呼び出しで過去にマップされた領域内のアドレスでなければならない。
142 .\"O specifies the address at which the file pages
152 で識別されるファイルページが置かれる予定のアドレスを、
156 .\"O The values specified in
160 .\"O should be multiples of the system page size.
161 .\"O If they are not, then the kernel rounds
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
172 に指定する値は、システムのページサイズの倍数とすべきである。
174 最も近いページサイズの倍数へ「切り下げる」。
175 .\" この丸め処理は風変わりで、munmap()/mprotect() や mlock() の
176 .\" 同様の引き数の処理方法とも矛盾する。
181 .\"O argument must be specified as 0.
183 引き数は 0 に指定されなければならない。
187 .\"O argument has the same meaning as for
189 .\"O but all flags other than
198 .\"O .SH "RETURN VALUE"
201 .\"O .BR remap_file_pages ()
203 .\"O On error, \-1 is returned, and
205 .\"O is set appropriately.
207 .BR remap_file_pages ()
217 .\"O does not refer to a valid mapping
218 .\"O created with the
224 フラグを指定して作成された有効なマッピングを参照していない。
238 .\"O .\" And possibly others from vma->vm_ops->populate()
240 .\"Osato: others が何を指すのかよく分からない。
242 .\" または vma->vm_ops->populate() からの他のエラーかもしれない。
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"
255 .\"O .BR remap_file_pages ()
256 .\"O system call is Linux-specific.
257 .BR remap_file_pages ()
258 システムコールは Linux 固有のものである。