OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man2 / remap_file_pages.2
1 .\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" 2003-12-10 Initial creation, Michael Kerrisk <mtk.manpages@gmail.com>
26 .\" 2004-10-28 aeb, corrected prototype, prot must be 0
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH REMAP_FILE_PAGES 2 2008\-04\-22 Linux "Linux Programmer's Manual"
34 .SH 名前
35 remap_file_pages \- 非線形ファイルマッピングを作成する。
36 .SH 書式
37 .nf
38 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
39 \fB#include <sys/mman.h>\fP
40 .sp
41 \fBint remap_file_pages(void *\fP\fIaddr\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIprot\fP\fB,\fP
42 \fB                     ssize_t \fP\fIpgoff\fP\fB, int \fP\fIflags\fP\fB);\fP
43 .fi
44 .SH 説明
45 \fBremap_file_pages\fP()  システムコールは非線形なマッピング、 つまりファイルのページがメモリ上で連続しない順番でマップされる
46 マッピングを作成するために使われる。 \fBremap_file_pages\fP()  を使う方が \fBmmap\fP(2)
47 を繰り返して使うより優れている点は、 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域)
48 データ構造体を追加で作成する必要がないことである。
49
50 非線形マッピングを作成するためには、 以下のようなステップを実行する:
51 .TP  3
52 1.
53 \fBmmap\fP(2)  を使い、マッピングを作成する (このマッピングは最初は線形である)。 このマッピングは \fBMAP_SHARED\fP
54 フラグを指定して作成されなければならない。
55 .TP 
56 2.
57 \fBremap_file_pages\fP()  を 1 回以上呼び出して、 マッピングのページとファイルのページの対応関係を再構成する。
58 ファイルの同じページをマッピング領域の複数の場所に マップすることが可能である。
59 .LP
60 \fIpgoff\fP と \fIsize\fP 引き数は、マッピング内で再配置されるファイルの領域を指定する。 \fIpgoff\fP
61 はファイルオフセットであり、単位はシステムのページサイズである。 \fIsize\fP は領域の長さであり、単位はバイトである。
62
63 \fIaddr\fP 引き数は 2 つの目的で使われる。 第 1 の目的は、この引き数によって再編成したいページの マッピングを識別することである。 よって
64 \fIaddr\fP は \fBmmap\fP(2)  の呼び出しで過去にマップされた領域内のアドレスでなければならない。 第 2 の目的は、 \fIpgoff\fP と
65 \fIsize\fP で識別されるファイルページが置かれる予定のアドレスを、 \fIaddr\fP によって指定することである。
66
67 .\" This rounding is weird, and not consistent with the treatment of
68 .\" the analogous arguments for munmap()/mprotect() and for mlock().
69 .\" MTK, 14 Sep 2005
70 \fIaddr\fP と \fIsize\fP に指定する値は、システムのページサイズの倍数とすべきである。 それ以外の場合、カーネルは「両方」の値を
71 最も近いページサイズの倍数へ「切り下げる」。
72
73 \fIprot\fP 引き数は 0 に指定されなければならない。
74
75 \fIflags\fP 引き数は \fBmmap\fP(2)  のものと同じ意味であるが、 \fBMAP_NONBLOCK\fP 以外の全てのフラグは無視される。
76 .SH 返り値
77 成功した場合、 \fBremap_file_pages\fP()  は 0 を返す。 エラーの場合、\-1 が返され、 \fIerrno\fP が適切に設定される。
78 .SH エラー
79 .TP 
80 \fBEINVAL\fP
81 \fIaddr\fP が \fBMAP_SHARED\fP フラグを指定して作成された有効なマッピングを参照していない。
82 .TP 
83 \fBEINVAL\fP
84 .\" And possibly others from vma->vm_ops->populate()
85 \fIaddr\fP, \fIsize\fP, \fIprot\fP, \fIpgoff\fP のいずれかが不正である。
86 .SH バージョン
87 \fBremap_file_pages\fP()  システムコールは Linux 2.5.46 で登場した。 glibc でのサポートは glibc
88 バージョン 2.3.3 で追加された。
89 .SH 準拠
90 \fBremap_file_pages\fP()  システムコールは Linux 固有のものである。
91 .SH 関連項目
92 \fBgetpagesize\fP(2), \fBmmap\fP(2), \fBmmap2\fP(2), \fBmprotect\fP(2), \fBmremap\fP(2),
93 \fBmsync\fP(2)
94 .SH この文書について
95 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
96 である。プロジェクトの説明とバグ報告に関する情報は
97 http://www.kernel.org/doc/man\-pages/ に書かれている。