OSDN Git Service

長音記号の修正を release に反映
[linuxjm/LDP_man-pages.git] / release / 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 .\"
34 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
35 .\"         all rights reserved.
36 .\" Translated Thu Jun 24 06:00:37 JST 2004
37 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated & Modified Mon Jan  3 02:50:11 JST 2005 by Yuichi SATO
39 .\" Updated & Modified Mon Oct 10 01:15:38 JST 2005
40 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
41 .\"
42 .TH REMAP_FILE_PAGES 2 2014\-05\-28 Linux "Linux Programmer's Manual"
43 .SH 名前
44 remap_file_pages \- 非線形ファイルマッピングを作成する。
45 .SH 書式
46 .nf
47 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
48 \fB#include <sys/mman.h>\fP
49 .sp
50 \fBint remap_file_pages(void *\fP\fIaddr\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIprot\fP\fB,\fP
51 \fB                     size_t \fP\fIpgoff\fP\fB, int \fP\fIflags\fP\fB);\fP
52 .fi
53 .SH 説明
54 .\" commit 33041a0d76d3c3e0aff28ac95a2ffdedf1282dbc
55 .\" http://lwn.net/Articles/597632/
56 \fB注意\fP: このシステムコールは (Linux 3.16 以降で) 非推奨となっており、
57 やがてより低速なカーネル内でのエミュレーションに置き換えられる予定である。
58 このシステムコールを使用しているアプリケーションは少ないが、こうしたアプリケーションは代替手段への移行を検討すべきである。
59
60 \fBremap_file_pages\fP()  システムコールは非線形なマッピング、 つまりファイルのページがメモリー上で連続しない順番でマップされる
61 マッピングを作成するために使われる。 \fBremap_file_pages\fP()  を使う方が \fBmmap\fP(2)
62 を繰り返して使うより優れている点は、 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリー領域)
63 データ構造体を追加で作成する必要がないことである。
64
65 非線形マッピングを作成するためには、 以下のようなステップを実行する:
66 .TP  3
67 1.
68 \fBmmap\fP(2)  を使い、マッピングを作成する (このマッピングは最初は線形である)。 このマッピングは \fBMAP_SHARED\fP
69 フラグを指定して作成されなければならない。
70 .TP 
71 2.
72 \fBremap_file_pages\fP()  を 1 回以上呼び出して、 マッピングのページとファイルのページの対応関係を再構成する。
73 ファイルの同じページをマッピング領域の複数の場所に マップすることが可能である。
74 .LP
75 \fIpgoff\fP と \fIsize\fP 引き数は、マッピング内で再配置されるファイルの領域を指定する。 \fIpgoff\fP
76 はファイルオフセットであり、単位はシステムのページサイズである。 \fIsize\fP は領域の長さであり、単位はバイトである。
77
78 \fIaddr\fP 引き数は 2 つの目的で使われる。 第 1 の目的は、この引き数によって再編成したいページの マッピングを識別することである。 よって
79 \fIaddr\fP は \fBmmap\fP(2)  の呼び出しで過去にマップされた領域内のアドレスでなければならない。 第 2 の目的は、 \fIpgoff\fP と
80 \fIsize\fP で識別されるファイルページが置かれる予定のアドレスを、 \fIaddr\fP によって指定することである。
81
82 .\" This rounding is weird, and not consistent with the treatment of
83 .\" the analogous arguments for munmap()/mprotect() and for mlock().
84 .\" MTK, 14 Sep 2005
85 \fIaddr\fP と \fIsize\fP に指定する値は、システムのページサイズの倍数とすべきである。 それ以外の場合、カーネルは「両方」の値を
86 最も近いページサイズの倍数へ「切り下げる」。
87
88 \fIprot\fP 引き数は 0 に指定されなければならない。
89
90 \fIflags\fP 引き数は \fBmmap\fP(2)  のものと同じ意味であるが、 \fBMAP_NONBLOCK\fP 以外の全てのフラグは無視される。
91 .SH 返り値
92 成功した場合、 \fBremap_file_pages\fP()  は 0 を返す。 エラーの場合、\-1 が返され、 \fIerrno\fP が適切に設定される。
93 .SH エラー
94 .TP 
95 \fBEINVAL\fP
96 \fIaddr\fP が \fBMAP_SHARED\fP フラグを指定して作成された有効なマッピングを参照していない。
97 .TP 
98 \fBEINVAL\fP
99 .\" And possibly others from vma->vm_ops->populate()
100 \fIaddr\fP, \fIsize\fP, \fIprot\fP, \fIpgoff\fP のいずれかが不正である。
101 .SH バージョン
102 \fBremap_file_pages\fP()  システムコールは Linux 2.5.46 で登場した。 glibc でのサポートは glibc
103 バージョン 2.3.3 で追加された。
104 .SH 準拠
105 \fBremap_file_pages\fP()  システムコールは Linux 固有のものである。
106 .SH 注意
107 .\" commit 3ee6dafc677a68e461a7ddafc94a580ebab80735
108 Linux 2.6.23 以降、 \fBremap_file_pages\fP() は tmpfs, hugetlbfs, ramfs
109 などのインメモリーファイルシステム上にのみ非線形マッピングを作成する。 裏にデータストアを持つファイルシステム上では、
110 \fBremap_file_pages\fP() は、 ファイルのどの部分がどのアドレスにマッピングされているかの調整が、 \fBmmap\fP(2)
111 を使った場合ほど効率的ではない。
112 .SH 関連項目
113 \fBgetpagesize\fP(2), \fBmmap\fP(2), \fBmmap2\fP(2), \fBmprotect\fP(2), \fBmremap\fP(2),
114 \fBmsync\fP(2)
115 .SH この文書について
116 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部
117 である。プロジェクトの説明とバグ報告に関する情報は
118 http://www.kernel.org/doc/man\-pages/ に書かれている。