1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 2004, Michael Kerrisk
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" 2004-05-40 Created by Michael Kerrisk <mtk.manpages@gmail.com>
26 .\" 2004-10-05 aeb, minor correction
28 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI
29 .\" all rights reserved.
30 .\" Translated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
32 .\"WORD: page cache ページ・キャッシュ
33 .\"WORD: file descriptor ファイル記述子
35 .TH READAHEAD 2 2010-09-10 "Linux" "Linux Programmer's Manual"
38 .\"O readahead \- perform file readahead into page cache
39 readahead \- 前もってファイルをページ・キャッシュに読み込む
43 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
44 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */"
47 .BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count );
52 .\"O populates the page cache with data from a file so that subsequent
53 .\"O reads from that file will not block on disk I/O.
55 は、この後の同じファイルからのデータ読み込み時にディスク I/O で
56 動作が停止 (block) しないように、前もってファイルの内容を
60 .\"O argument is a file descriptor identifying the file which is
63 引き数は読み込みを行うファイルを識別するファイル・ディスクリプタである。
66 .\"O argument specifies the starting point from which data is to be read
69 .\"O specifies the number of bytes to be read.
74 .\"O I/O is performed in whole pages, so that
76 .\"O is effectively rounded down to a page boundary
77 .\"O and bytes are read up to the next page boundary greater than or
79 .\"O .IR "(offset+count)" .
80 ディスク I/O はページ単位で実行されるので、
83 はページ境界に切り下げられ、読み込みバイト数は
85 より小さくない次のページ境界まで切り上げられる。
87 .\"O does not read beyond the end of the file.
89 .\"O blocks until the specified data has been read.
91 はファイルの末尾を越えた範囲まで読み出しを行うことはない。また、
93 は指定したデータの読み込みが終わるまで停止 (block) する。
94 .\"O The current file offset of the open file referred to by
96 .\"O is left unchanged.
98 で参照されたオープン済のファイルのファイルオフセットの現在値は
100 .\"O .SH "RETURN VALUE"
103 .\"O .BR readahead ()
104 .\"O returns 0; on failure, \-1 is returned, with
106 .\"O set to indicate the cause of the error.
108 は成功すると 0 を返す。失敗した場合 \-1 を返し、
116 .\"O is not a valid file descriptor or is not open for reading.
118 が有効なファイル・ディスクリプタでない、または
123 .\"O does not refer to a file type to which
124 .\"O .BR readahead ()
129 を行うことができないタイプのファイルであった。
133 .\"O .BR readahead ()
134 .\"O system call appeared in Linux 2.4.13;
135 .\"O glibc support has been provided since version 2.3.
137 システムコールは Linux 2.4.13 で登場した。
138 glibc でのサポートは glibc バージョン 2.3 以降で行われている。
139 .\"O .SH "CONFORMING TO"
142 .\"O .BR readahead ()
143 .\"O system call is Linux-specific, and its use should be avoided
144 .\"O in portable applications.
146 システムコールは Linux 固有であり、移植を考慮したプログラムでは
153 .BR posix_fadvise (2),