OSDN Git Service

45de3168d399d7f0cd1b74a54330bb59638c697e
[linuxjm/LDP_man-pages.git] / draft / man2 / readahead.2
1 .\" This manpage is Copyright (C) 2004, 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 .\" 2004-05-40 Created by Michael Kerrisk <mtk.manpages@gmail.com>
26 .\" 2004-10-05 aeb, minor correction
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH READAHEAD 2 2013\-04\-01 Linux "Linux Programmer's Manual"
34 .SH 名前
35 readahead \- 前もってファイルをページ・キャッシュに読み込む
36 .SH 書式
37 .nf
38 \fB#define _GNU_SOURCE\fP             /* feature_test_macros(7) 参照 */
39 \fB#include <fcntl.h>\fP
40 .sp
41 \fBssize_t readahead(int \fP\fIfd\fP\fB, off64_t \fP\fIoffset\fP\fB, size_t \fP\fIcount\fP\fB);\fP
42 .fi
43 .SH 説明
44 \fBreadahead\fP()  は、この後の同じファイルからのデータ読み込み時にディスク I/O で 動作が停止 (block)
45 しないように、前もってファイルの内容を ページ・キャッシュに読み込む。 \fIfd\fP
46 引き数は読み込みを行うファイルを識別するファイル・ディスクリプタである。 \fIoffset\fP 引き数はデータの読み込み開始位置を指定し、
47 \fIcount\fP は読み込むデータのバイト数を指定する。 ディスク I/O はページ単位で実行されるので、 実際には \fIoffset\fP
48 はページ境界に切り下げられ、読み込みバイト数は \fI(offset+count)\fP より小さくない次のページ境界まで切り上げられる。
49 \fBreadahead\fP()  はファイルの末尾を越えた範囲まで読み出しを行うことはない。また、 \fBreadahead\fP()
50 は指定したデータの読み込みが終わるまで停止 (block) する。 \fIfd\fP で参照されたオープン済のファイルのファイルオフセットの現在値は
51 変更されない。
52 .SH 返り値
53 \fBreadahead\fP()  は成功すると 0 を返す。失敗した場合 \-1 を返し、 \fIerrno\fP にエラーの原因を示す値を設定する。
54 .SH エラー
55 .TP 
56 \fBEBADF\fP
57 \fIfd\fP が有効なファイル・ディスクリプタでない、または 読み込み用にオープンされていない。
58 .TP 
59 \fBEINVAL\fP
60 \fIfd\fP が参照しているファイルが、 \fBreadahead\fP()  を行うことができないタイプのファイルであった。
61 .SH バージョン
62 \fBreadahead\fP()  システムコールは Linux 2.4.13 で登場した。 glibc でのサポートは glibc バージョン 2.3
63 以降で行われている。
64 .SH 準拠
65 \fBreadahead\fP()  システムコールは Linux 固有であり、移植を考慮したプログラムでは 使用を避けるべきである。
66 .SH 注意
67 いくつかの 32 ビットアーキテクチャでは、このシステムコールの呼び出しシグネチャーが違っている。 理由は \fBsyscall\fP(2)
68 で説明されている。
69 .SH 関連項目
70 \fBlseek\fP(2), \fBmadvise\fP(2), \fBmmap\fP(2), \fBposix_fadvise\fP(2), \fBread\fP(2)
71 .SH この文書について
72 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
73 である。プロジェクトの説明とバグ報告に関する情報は
74 http://www.kernel.org/doc/man\-pages/ に書かれている。