OSDN Git Service

2ebf0f62ddf3568584c1f26f0c240fd8efc7a38d
[linuxjm/LDP_man-pages.git] / draft / man2 / mmap2.2
1 .\" Copyright (C) 2002, Michael Kerrisk
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 .\" Modified 31 Jan 2002, Michael Kerrisk <mtk.manpages@gmail.com>
26 .\"     Added description of mmap2
27 .\" Modified, 2004-11-25, mtk -- removed stray #endif in prototype
28 .\"
29 .\"*******************************************************************
30 .\"
31 .\" This file was generated with po4a. Translate the source file.
32 .\"
33 .\"*******************************************************************
34 .TH MMAP2 2 2012\-04\-16 Linux "Linux Programmer's Manual"
35 .SH 名前
36 mmap2 \- ファイルやデバイスをメモリにマップする
37 .SH 書式
38 .nf
39 \fB#include <sys/mman.h>\fP
40 .sp
41 \fBvoid *mmap2(void *\fP\fIaddr\fP\fB, size_t \fP\fIlength\fP\fB, int \fP\fIprot\fP\fB,\fP
42 \fB            int \fP\fIflags\fP\fB, int \fP\fIfd\fP\fB, off_t \fP\fIpgoffset\fP\fB);\fP
43 .fi
44 .SH 説明
45 これはおそらくあなたが興味のあるシステムコールではないだろう。代わりに
46 \fBmmap\fP(2) を見るとよい。そのページにはこのシステムコールを起動する glibc の
47 ラッパー関数についての説明がある。
48
49 \fBmmap2\fP() システムコールは \fBmmap\fP(2) と同じインターフェースを提供する。ただ
50 し、最後の引き数には、ファイルのオフセットを (\fBmmap\fP(2) が行っている、バイト
51 単位ではなく) 4096 バイトを単位として指定する。 これにより、32 ビットの
52 \fIoff_t\fP を使うアプリケーションで (2^44 バイトまでの) 大きなファイルをマップ
53 できるようになる。
54 .SH 返り値
55 成功した場合、 \fBmmap2\fP()  はマップされた領域へのポインタを返す。 エラーの場合は \-1 が返されて、 \fIerrno\fP
56 が適切に設定される。
57 .SH エラー
58 .TP 
59 \fBEFAULT\fP
60 ユーザ空間からデータを取得するときに問題があった。
61 .TP 
62 \fBEINVAL\fP
63 (Various platforms where the page size is not 4096 bytes.)  \fIoffset\ *\ 4096\fP is not a multiple of the system page size.
64 .PP
65 \fBmmap2\fP() は \fBmmap\fP(2) に載っているエラーを返すこともある。
66 .SH バージョン
67 \fBmmap2\fP()  は、Linux 2.3.31 以降で使用可能である。
68 .SH 準拠
69 このシステムコールは Linux 独自である。
70 .SH 注意
71 現在では、glibc の \fBmmap\fP()  のラッパー関数は、 \fBmmap\fP(2)  システムコールではなく、このシステムコール
72 (\fBmmap2\fP(2))  を起動する。
73
74 .\" ia64 can have page sizes ranging from 4kB to 64kB.
75 .\" On cris, it looks like the unit might also be the page size,
76 .\" which is 8192 bytes. -- mtk, June 2007
77 ia64 では、 \fIoffset\fP の単位は、実際にはシステムのページサイズであり、 4096 バイトではない。
78 .SH 関連項目
79 \fBgetpagesize\fP(2), \fBmmap\fP(2), \fBmremap\fP(2), \fBmsync\fP(2), \fBshm_open\fP(3)
80 .SH この文書について
81 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
82 である。プロジェクトの説明とバグ報告に関する情報は
83 http://www.kernel.org/doc/man\-pages/ に書かれている。