OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / remap_file_pages.2
index 243db3a..be48180 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2003, Michael Kerrisk (mtk.manpages@gmail.com)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" 2003-12-10 Initial creation, Michael Kerrisk <mtk.manpages@gmail.com>
 .\" 2004-10-28 aeb, corrected prototype, prot must be 0
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
 .\"         all rights reserved.
 .\" Translated Thu Jun 24 06:00:37 JST 2004
 .\" Updated & Modified Mon Oct 10 01:15:38 JST 2005
 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\"
-.TH REMAP_FILE_PAGES 2 2008-04-22 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O remap_file_pages \- create a nonlinear file mapping
-remap_file_pages \- ÈóÀþ·Á¥Õ¥¡¥¤¥ë¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¡£
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH REMAP_FILE_PAGES 2 2008\-04\-22 Linux "Linux Programmer's Manual"
+.SH 名前
+remap_file_pages \- 非線形ファイルマッピングを作成する。
+.SH 書式
 .nf
-.B #define _GNU_SOURCE
-.B #include <sys/mman.h>
+\fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
+\fB#include <sys/mman.h>\fP
 .sp
-.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot ,
-.BI "                     ssize_t " pgoff ", int " flags );
+\fBint remap_file_pages(void *\fP\fIaddr\fP\fB, size_t \fP\fIsize\fP\fB, int \fP\fIprot\fP\fB,\fP
+\fB                     ssize_t \fP\fIpgoff\fP\fB, int \fP\fIflags\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O The
-.\"O .BR remap_file_pages ()
-.\"O system call is used to create a nonlinear mapping, that is, a mapping
-.\"O in which the pages of the file are mapped into a nonsequential order
-.\"O in memory.
-.BR remap_file_pages ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÏÈóÀþ·Á¤Ê¥Þ¥Ã¥Ô¥ó¥°¡¢
-¤Ä¤Þ¤ê¥Õ¥¡¥¤¥ë¤Î¥Ú¡¼¥¸¤¬¥á¥â¥ê¾å¤ÇϢ³¤·¤Ê¤¤½çÈ֤ǥޥåפµ¤ì¤ë
-¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¤¿¤á¤Ë»È¤ï¤ì¤ë¡£
-.\"O The advantage of using
-.\"O .BR remap_file_pages ()
-.\"O over using repeated calls to
-.\"O .BR mmap (2)
-.\"O is that the former approach does not require the kernel to create
-.\"O additional VMA (Virtual Memory Area) data structures.
-.BR remap_file_pages ()
-¤ò»È¤¦Êý¤¬
-.BR mmap (2)
-¤ò·«¤êÊÖ¤·¤Æ»È¤¦¤è¤êÍ¥¤ì¤Æ¤¤¤ëÅÀ¤Ï¡¢
-Á°¼Ô¤ÎÊýË¡¤Ç¤Ï¥«¡¼¥Í¥ë¤¬ VMA (Virtual Memory Area, ²¾ÁÛ¥á¥â¥êÎΰè)
-¥Ç¡¼¥¿¹½Â¤ÂΤòÄɲäǺîÀ®¤¹¤ëɬÍפ¬¤Ê¤¤¤³¤È¤Ç¤¢¤ë¡£
+.SH 説明
+\fBremap_file_pages\fP()  システムコールは非線形なマッピング、 つまりファイルのページがメモリ上で連続しない順番でマップされる
+マッピングを作成するために使われる。 \fBremap_file_pages\fP()  を使う方が \fBmmap\fP(2)
+を繰り返して使うより優れている点は、 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモリ領域)
+データ構造体を追加で作成する必要がないことである。
 
-.\"O To create a nonlinear mapping we perform the following steps:
-ÈóÀþ·Á¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢
-°Ê²¼¤Î¤è¤¦¤Ê¥¹¥Æ¥Ã¥×¤ò¼Â¹Ô¤¹¤ë:
-.TP 3
+非線形マッピングを作成するためには、 以下のようなステップを実行する:
+.TP  3
 1.
-.\"O Use
-.\"O .BR mmap (2)
-.\"O to create a mapping (which is initially linear).
-.BR mmap (2)
-¤ò»È¤¤¡¢¥Þ¥Ã¥Ô¥ó¥°¤òºîÀ®¤¹¤ë (¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤ÏºÇ½é¤ÏÀþ·Á¤Ç¤¢¤ë)¡£
-.\"O This mapping must be created with the
-.\"O .B MAP_SHARED
-.\"O flag.
-¤³¤Î¥Þ¥Ã¥Ô¥ó¥°¤Ï
-.B MAP_SHARED
-¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.TP
+\fBmmap\fP(2)  を使い、マッピングを作成する (このマッピングは最初は線形である)。 このマッピングは \fBMAP_SHARED\fP
+フラグを指定して作成されなければならない。
+.TP 
 2.
-.\"O Use one or more calls to
-.\"O .BR remap_file_pages ()
-.\"O to rearrange the correspondence between the pages of the mapping
-.\"O and the pages of the file.
-.\"O It is possible to map the same page of a file
-.\"O into multiple locations within the mapped region.
-.BR remap_file_pages ()
-¤ò 1 ²ó°Ê¾å¸Æ¤Ó½Ð¤·¤Æ¡¢
-¥Þ¥Ã¥Ô¥ó¥°¤Î¥Ú¡¼¥¸¤È¥Õ¥¡¥¤¥ë¤Î¥Ú¡¼¥¸¤ÎÂбþ´Ø·¸¤òºÆ¹½À®¤¹¤ë¡£
-¥Õ¥¡¥¤¥ë¤ÎƱ¤¸¥Ú¡¼¥¸¤ò¥Þ¥Ã¥Ô¥ó¥°Îΰè¤ÎÊ£¿ô¤Î¾ì½ê¤Ë
-¥Þ¥Ã¥×¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¡£
+\fBremap_file_pages\fP()  を 1 回以上呼び出して、 マッピングのページとファイルのページの対応関係を再構成する。
+ファイルの同じページをマッピング領域の複数の場所に マップすることが可能である。
 .LP
-.\"O The
-.\"O .I pgoff
-.\"O and
-.\"O .I size
-.\"O arguments specify the region of the file that is to be relocated
-.\"O within the mapping:
-.I pgoff
-¤È
-.I size
-°ú¤­¿ô¤Ï¡¢¥Þ¥Ã¥Ô¥ó¥°Æâ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤ÎÎΰè¤ò»ØÄꤹ¤ë¡£
-.\"O .I pgoff
-.\"O is a file offset in units of the system page size;
-.I pgoff
-¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Ç¤¢¤ê¡¢Ã±°Ì¤Ï¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤Ç¤¢¤ë¡£
-.\"O .I size
-.\"O is the length of the region in bytes.
-.I size
-¤ÏÎΰè¤ÎŤµ¤Ç¤¢¤ê¡¢Ã±°Ì¤Ï¥Ð¥¤¥È¤Ç¤¢¤ë¡£
+\fIpgoff\fP と \fIsize\fP 引き数は、マッピング内で再配置されるファイルの領域を指定する。 \fIpgoff\fP
+はファイルオフセットであり、単位はシステムのページサイズである。 \fIsize\fP は領域の長さであり、単位はバイトである。
 
-.\"O The
-.\"O .I addr
-.\"O argument serves two purposes.
-.I addr
-°ú¤­¿ô¤Ï 2 ¤Ä¤ÎÌÜŪ¤Ç»È¤ï¤ì¤ë¡£
-.\"O First, it identifies the mapping whose pages we want to rearrange.
-Âè 1 ¤ÎÌÜŪ¤Ï¡¢¤³¤Î°ú¤­¿ô¤Ë¤è¤Ã¤ÆºÆÊÔÀ®¤·¤¿¤¤¥Ú¡¼¥¸¤Î
-¥Þ¥Ã¥Ô¥ó¥°¤ò¼±Ê̤¹¤ë¤³¤È¤Ç¤¢¤ë¡£
-.\"O Thus,
-.\"O .I addr
-.\"O must be an address that falls within
-.\"O a region previously mapped by a call to
-.\"O .BR mmap (2).
-¤è¤Ã¤Æ
-.I addr
-¤Ï
-.BR mmap (2)
-¤Î¸Æ¤Ó½Ð¤·¤Ç²áµî¤Ë¥Þ¥Ã¥×¤µ¤ì¤¿ÎΰèÆâ¤Î¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O Second,
-.\"O .I addr
-.\"O specifies the address at which the file pages
-.\"O identified by
-.\"O .I pgoff
-.\"O and
-.\"O .I size
-.\"O will be placed.
-Âè 2 ¤ÎÌÜŪ¤Ï¡¢
-.I pgoff
-¤È
-.I size
-¤Ç¼±Ê̤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ú¡¼¥¸¤¬ÃÖ¤«¤ì¤ëͽÄê¤Î¥¢¥É¥ì¥¹¤ò¡¢
-.I addr
-¤Ë¤è¤Ã¤Æ»ØÄꤹ¤ë¤³¤È¤Ç¤¢¤ë¡£
+\fIaddr\fP 引き数は 2 つの目的で使われる。 第 1 の目的は、この引き数によって再編成したいページの マッピングを識別することである。 よって
+\fIaddr\fP は \fBmmap\fP(2)  の呼び出しで過去にマップされた領域内のアドレスでなければならない。 第 2 の目的は、 \fIpgoff\fP と
+\fIsize\fP で識別されるファイルページが置かれる予定のアドレスを、 \fIaddr\fP によって指定することである。
 
-.\"O The values specified in
-.\"O .I addr
-.\"O and
-.\"O .I size
-.\"O should be multiples of the system page size.
-.\"O If they are not, then the kernel rounds
-.\"O .I both
-.\"O values
-.\"O .I down
-.\"O to the nearest multiple of the page size.
-.\"O .\" This rounding is weird, and not consistent with the treatment of
-.\"O .\" the analogous arguments for munmap()/mprotect() and for mlock().
-.\"O .\" MTK, 14 Sep 2005
-.I addr
-¤È
-.I size
-¤Ë»ØÄꤹ¤ëÃͤϡ¢¥·¥¹¥Æ¥à¤Î¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤È¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-¤½¤ì°Ê³°¤Î¾ì¹ç¡¢¥«¡¼¥Í¥ë¤Ï¡ÖξÊý¡×¤ÎÃͤò
-ºÇ¤â¶á¤¤¥Ú¡¼¥¸¥µ¥¤¥º¤ÎÇÜ¿ô¤Ø¡ÖÀڤ겼¤²¤ë¡×¡£
-.\" ¤³¤Î´Ý¤á½èÍý¤ÏÉ÷ÊѤï¤ê¤Ç¡¢munmap()/mprotect() ¤ä mlock() ¤Î
-.\" Æ±Íͤΰú¤­¿ô¤Î½èÍýÊýË¡¤È¤âÌ·½â¤¹¤ë¡£
+.\" This rounding is weird, and not consistent with the treatment of
+.\" the analogous arguments for munmap()/mprotect() and for mlock().
 .\" MTK, 14 Sep 2005
+\fIaddr\fP と \fIsize\fP に指定する値は、システムのページサイズの倍数とすべきである。 それ以外の場合、カーネルは「両方」の値を
+最も近いページサイズの倍数へ「切り下げる」。
 
-.\"O The
-.\"O .I prot
-.\"O argument must be specified as 0.
-.I prot
-°ú¤­¿ô¤Ï 0 ¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+\fIprot\fP 引き数は 0 に指定されなければならない。
 
-.\"O The
-.\"O .I flags
-.\"O argument has the same meaning as for
-.\"O .BR mmap (2),
-.\"O but all flags other than
-.\"O .B MAP_NONBLOCK
-.\"O are ignored.
-.I flags
-°ú¤­¿ô¤Ï
-.BR mmap (2)
-¤Î¤â¤Î¤ÈƱ¤¸°ÕÌ£¤Ç¤¢¤ë¤¬¡¢
-.B MAP_NONBLOCK
-°Ê³°¤ÎÁ´¤Æ¤Î¥Õ¥é¥°¤Ï̵»ë¤µ¤ì¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success,
-.\"O .BR remap_file_pages ()
-.\"O returns 0.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¡¢
-.BR remap_file_pages ()
-¤Ï 0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EINVAL
-.\"O .I addr
-.\"O does not refer to a valid mapping
-.\"O created with the
-.\"O .B MAP_SHARED
-.\"O flag.
-.I addr
-¤¬
-.B MAP_SHARED
-¥Õ¥é¥°¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤¿Í­¸ú¤Ê¥Þ¥Ã¥Ô¥ó¥°¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
-.TP
-.B EINVAL
-.\"O .IR addr ,
-.\"O .IR size ,
-.\"O .IR prot ,
-.\"O or
-.\"O .I pgoff
-.\"O is invalid.
-.IR addr ,
-.IR size ,
-.IR prot ,
-.I pgoff
-¤Î¤¤¤º¤ì¤«¤¬ÉÔÀµ¤Ç¤¢¤ë¡£
-.\"O .\" And possibly others from vma->vm_ops->populate()
-.\"Osato:
-.\"Osato: others ¤¬²¿¤ò»Ø¤¹¤Î¤«¤è¤¯Ê¬¤«¤é¤Ê¤¤¡£
-.\"Osato:
-.\" ¤Þ¤¿¤Ï vma->vm_ops->populate() ¤«¤é¤Î¾¤Î¥¨¥é¡¼¤«¤â¤·¤ì¤Ê¤¤¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O The
-.\"O .BR remap_file_pages ()
-.\"O system call appeared in Linux 2.5.46;
-.\"O glibc support was added in version 2.3.3.
-.BR remap_file_pages ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux 2.5.46 ¤ÇÅо줷¤¿¡£
-glibc ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.3 ¤ÇÄɲ䵤줿¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O The
-.\"O .BR remap_file_pages ()
-.\"O system call is Linux-specific.
-.BR remap_file_pages ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux ¸ÇÍ­¤Î¤â¤Î¤Ç¤¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR getpagesize (2),
-.BR mmap (2),
-.BR mmap2 (2),
-.BR mprotect (2),
-.BR mremap (2),
-.BR msync (2),
-.BR feature_test_macros (7)
+\fIflags\fP 引き数は \fBmmap\fP(2)  のものと同じ意味であるが、 \fBMAP_NONBLOCK\fP 以外の全てのフラグは無視される。
+.SH 返り値
+成功した場合、 \fBremap_file_pages\fP()  は 0 を返す。 エラーの場合、\-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+.TP 
+\fBEINVAL\fP
+\fIaddr\fP が \fBMAP_SHARED\fP フラグを指定して作成された有効なマッピングを参照していない。
+.TP 
+\fBEINVAL\fP
+.\" And possibly others from vma->vm_ops->populate()
+\fIaddr\fP, \fIsize\fP, \fIprot\fP, \fIpgoff\fP のいずれかが不正である。
+.SH バージョン
+\fBremap_file_pages\fP()  システムコールは Linux 2.5.46 で登場した。 glibc でのサポートは glibc
+バージョン 2.3.3 で追加された。
+.SH 準拠
+\fBremap_file_pages\fP()  システムコールは Linux 固有のものである。
+.SH 関連項目
+\fBgetpagesize\fP(2), \fBmmap\fP(2), \fBmmap2\fP(2), \fBmprotect\fP(2), \fBmremap\fP(2),
+\fBmsync\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。