OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / posix_fadvise.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 2003 Abhijit Menon-Sen <ams@wiw.org>
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 .\"
24 .\" 2005-04-08 mtk, noted kernel version and added BUGS
25 .\"
26 .\" Japanese Version Copyright (c) 2004-2007 Yuichi SATO
27 .\"         all rights reserved.
28 .\" Translated Sun Jun 20 16:23:17 JST 2004
29 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v1.66
30 .\" Updated & Modified Fri Apr 22 03:05:51 JST 2005 by Yuichi SATO, LDP v2.02
31 .\" Updated & Modified Thu Jan  4 23:55:18 JST 2007 by Yuichi SATO, LDP v2.43
32 .\"
33 .TH POSIX_FADVISE 2 2003-02-14 "Linux" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .SH 名前
36 .\"O posix_fadvise \- predeclare an access pattern for file data
37 posix_fadvise \- ファイルデータのアクセスパターンをあらかじめ宣言する
38 .\"O .SH SYNOPSIS
39 .SH 書式
40 .nf
41 .B #define _XOPEN_SOURCE 600
42 .B #include <fcntl.h>
43 .sp
44 .BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " len \
45 ", int " advice ");"
46 .fi
47 .\"O .SH DESCRIPTION
48 .SH 説明
49 .\"O Programs can use
50 .\"O .BR posix_fadvise ()
51 .\"O to announce an intention to access
52 .\"O file data in a specific pattern in the future, thus allowing the kernel
53 .\"O to perform appropriate optimizations.
54 プログラムは、将来特定のパターンでファイルデータに
55 アクセスする意思を伝えるために
56 .BR posix_fadvise ()
57 を使うことができる。
58 これにより、カーネルが適切な最適化を実行することが可能になる。
59
60 .\"O The \fIadvice\fP applies to a (not necessarily existent) region starting
61 .\"O at \fIoffset\fP and extending for \fIlen\fP bytes (or until the end of
62 .\"O the file if \fIlen\fP is 0) within the file referred to by \fIfd\fP.
63 .\"O The advice is not binding; it merely constitutes an expectation on behalf of
64 .\"O the application.
65 \fIadvice\fP は  \fIfd\fP が参照しているファイルの
66 \fIoffset\fP から始まる \fIlen\fP バイトの範囲内
67 (\fIlen\fP が 0 の場合はファイルの終りまで) の
68 (必ずしも存在しない) 領域に適用される。
69 アドバイスは義務づけではない。
70 アドバイスは単にアプリケーションのために可能性を構成するだけである。
71
72 .\"O Permissible values for \fIadvice\fP include:
73 \fIadvice\fP に許される値には、以下のものが含まれる:
74 .TP
75 .B POSIX_FADV_NORMAL
76 .\"O Indicates that the application has no advice to give about its access
77 .\"O pattern for the specified data.
78 .\"O If no advice is given for an open file,
79 .\"O this is the default assumption.
80 指定されたデータのアクセスパターンを指示するアドバイスを
81 アプリケーションが何も持っていないことを示す。
82 オープンされたファイルにアドバイスが指定されない場合、
83 これがデフォルトで仮定される。
84 .TP
85 .B POSIX_FADV_SEQUENTIAL
86 .\"O The application expects to access the specified data sequentially (with
87 .\"O lower offsets read before higher ones).
88 アプリケーションは指定されたデータがシーケンシャルに
89 (大きなオフセットの前に小さなオフセットのデータを読むように)
90 アクセスされることを期待する。
91 .TP
92 .B POSIX_FADV_RANDOM
93 .\"O The specified data will be accessed in random order.
94 指定されたデータがランダムな順番でアクセスされる。
95 .TP
96 .B POSIX_FADV_NOREUSE
97 .\"O The specified data will be accessed only once.
98 指定されたデータは 1 度しかアクセスされない。
99 .TP
100 .B POSIX_FADV_WILLNEED
101 .\"O The specified data will be accessed in the near future.
102 指定されたデータは近い将来アクセスされる。
103 .TP
104 .B POSIX_FADV_DONTNEED
105 .\"O The specified data will not be accessed in the near future.
106 指定されたデータは近い将来アクセスされない。
107 .\"O .SH "RETURN VALUE"
108 .SH 返り値
109 .\"O On success, zero is returned.
110 .\"O On error, an error number is returned.
111 成功した場合は 0 が返される。
112 失敗した場合はエラー番号が返される。
113 .\"O .SH ERRORS
114 .SH エラー
115 .TP
116 .B EBADF
117 .\"O The \fIfd\fP argument was not a valid file descriptor.
118 \fIfd\fP 引き数が有効なファイルディスクリプタでない。
119 .TP
120 .B EINVAL
121 .\"O An invalid value was specified for \fIadvice\fP.
122 無効な値が \fIadvice\fP に指定された。
123 .TP
124 .B ESPIPE
125 .\"O returns EINVAL in this case.)
126 .\"O The specified file descriptor refers to a pipe or FIFO.
127 .\"O (Linux actually
128 .\"O returns
129 .\"O .B EINVAL
130 .\"O in this case.)
131 指定されたファイルディスクリプタがパイプまたは FIFO を参照している
132 (この場合、Linux は実際には
133 .B EINVAL
134 を返す)。
135 .\"O .SH VERSIONS
136 .SH バージョン
137 .\"O .BR posix_fadvise ()
138 .\"O appeared in kernel 2.5.60.
139 .\"O .\" Actually as fadvise64() -- MTK
140 .\"O Glibc support has been provided since version 2.2.
141 .BR posix_fadvise ()
142 はカーネル 2.5.60 で登場した。
143 .\" 実際には fadvise64() として登場した。-- MTK
144 glibc でのサポートは glibc バージョン 2.2 以降で行われている。
145 .\"O .SH "CONFORMING TO"
146 .SH 準拠
147 POSIX.1-2001.
148 .\"O Note that the type of the
149 .\"O .I len
150 .\"O argument was changed from
151 .\"O .I size_t
152 .\"O to
153 .\"O .I off_t
154 .\"O in POSIX.1-2003 TC1.
155 .I len
156 引き数の型が POSIX.1-2003 TC1 において
157 .I size_t
158 から
159 .I off_t
160 に変更された点に注意すること。
161 .\"O .SH NOTES
162 .\"O Under Linux, \fBPOSIX_FADV_NORMAL\fP sets the readahead window to the
163 .\"O default size for the backing device; \fBPOSIX_FADV_SEQUENTIAL\fP doubles
164 .\"O this size, and \fBPOSIX_FADV_RANDOM\fP disables file readahead entirely.
165 .SH 注意
166 Linux では、\fBPOSIX_FADV_NORMAL\fP はバッキングデバイスの
167 デフォルトサイズに先読み (readahead) ウインドウを設定する。
168 \fBPOSIX_FADV_SEQUENTIAL\fP はこのサイズを 2 倍し、
169 \fBPOSIX_FADV_RANDOM\fP は先読みを全く無効にする。
170 .\"O These changes affect the entire file, not just the specified region
171 .\"O (but other open file handles to the same file are unaffected).
172 これらの変更はファイル全体に影響し、指定された領域のみに影響するわけではない
173 (しかし同じファイルに対する他のオープンファイルハンドルは影響を受けない)。
174
175 .\"O \fBPOSIX_FADV_WILLNEED\fP initiates a
176 .\"O nonblocking read of the specified region into the page cache.
177 .\"O The amount of data read may be decreased by the kernel depending
178 .\"O on virtual memory load.
179 .\"O (A few megabytes will usually be fully satisfied,
180 .\"O and more is rarely useful.)
181 \fBPOSIX_FADV_WILLNEED\fP は、
182 ページキャッシュに指定領域のブロックされない読み込みを開始する。
183 読み込まれるデータの総量は、
184 仮想メモリの負荷に依ってカーネルが減らすかもしれない
185 (数メガバイトであれば通常は全く十分であり、
186 それより多くてもめったに役に立たない)。
187
188 .\"O In kernels before 2.6.18, \fBPOSIX_FADV_NOREUSE\fP had the
189 .\"O same semantics as \fBPOSIX_FADV_WILLNEED\fP.
190 .\"O This was probably a bug; since kernel 2.6.18, this flag is a no-op.
191 2.6.18 より前のカーネルでは、\fBPOSIX_FADV_NOREUSE\fP は
192 \fBPOSIX_FADV_WILLNEED\fP と同じ意味であった。
193 これは多分バグであった。
194 カーネル 2.6.18 以降では、このフラグは何も行わない。
195
196 .\"O \fBPOSIX_FADV_DONTNEED\fP attempts to free cached pages associated with
197 .\"O the specified region.
198 .\"O This is useful, for example, while streaming large
199 .\"O files.
200 .\"O A program may periodically request the kernel to free cached data
201 .\"O that has already been used, so that more useful cached pages are not
202 .\"O discarded instead.
203 \fBPOSIX_FADV_DONTNEED\fP は指定された領域に関連付けられた
204 キャッシュページを解放しようとする。
205 例えば、これは大きなファイルをストリーミングするときに役立つ。
206 プログラムは、使用済みのキャッシュされたデータを解放するように、
207 定期的にカーネルに要求するかもしれない。
208 そうすることにより、さらに有効なキャッシュされたページが、
209 代わりに破棄されることはない。
210
211 .\"O Pages that have not yet been written out will be unaffected, so if the
212 .\"O application wishes to guarantee that pages will be released, it should
213 .\"O call
214 .\"O .BR fsync (2)
215 .\"O or
216 .\"O .BR fdatasync (2)
217 .\"O first.
218 まだ書き出されていないページは影響を受けないので、
219 そのページの解放が保証されることをアプリケーションが望んでいるなら、
220 最初に
221 .BR fsync (2)
222 または
223 .BR fdatasync (2)
224 を呼ぶべきである。
225 .\"O .SH BUGS
226 .SH バグ
227 .\"O In kernels before 2.6.6, if
228 .\"O .I len
229 .\"O was specified as 0, then this was interpreted literally as "zero bytes",
230 .\"O rather than as meaning "all bytes through to the end of the file".
231 2.6.6 より前のカーネルでは、
232 .I len
233 に 0 が指定された場合、
234 「ファイルの終りまでの全てのバイト」という意味ではなく、
235 文字通り「0 バイト」として解釈されていた。
236 .\"O .SH "SEE ALSO"
237 .SH 関連項目
238 .BR readahead (2),
239 .BR posix_fallocate (3),
240 .BR posix_madvise (3)
241 .\" FIXME . Write a posix_fadvise(3) page.