OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / readahead.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 2004, Michael Kerrisk
4 .\"
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.
8 .\"
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.
13 .\"
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
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" 2004-05-40 Created by Michael Kerrisk <mtk.manpages@gmail.com>
26 .\" 2004-10-05 aeb, minor correction
27 .\"
28 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI
29 .\"         all rights reserved.
30 .\" Translated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
31 .\"
32 .\"WORD:        page cache      ページ・キャッシュ
33 .\"WORD:        file descriptor ファイル記述子
34 .\"
35 .TH READAHEAD 2 2010-09-10 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH 名前
38 .\"O readahead \- perform file readahead into page cache
39 readahead \- 前もってファイルをページ・キャッシュに読み込む
40 .\"O .SH SYNOPSIS
41 .SH 書式
42 .nf
43 .\"O .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
44 .BR "#define _GNU_SOURCE" "             /* feature_test_macros(7) 参照 */"
45 .B #include <fcntl.h>
46 .sp
47 .BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count );
48 .fi
49 .\"O .SH DESCRIPTION
50 .SH 説明
51 .\"O .BR readahead ()
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.
54 .BR readahead ()
55 は、この後の同じファイルからのデータ読み込み時にディスク I/O で
56 動作が停止 (block) しないように、前もってファイルの内容を
57 ページ・キャッシュに読み込む。
58 .\"O The
59 .\"O .I fd
60 .\"O argument is a file descriptor identifying the file which is
61 .\"O to be read.
62 .I fd
63 引き数は読み込みを行うファイルを識別するファイル・ディスクリプタである。
64 .\"O The
65 .\"O .I offset
66 .\"O argument specifies the starting point from which data is to be read
67 .\"O and
68 .\"O .I count
69 .\"O specifies the number of bytes to be read.
70 .I offset
71 引き数はデータの読み込み開始位置を指定し、
72 .I count
73 は読み込むデータのバイト数を指定する。
74 .\"O I/O is performed in whole pages, so that
75 .\"O .I offset
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
78 .\"O equal to
79 .\"O .IR "(offset+count)" .
80 ディスク I/O はページ単位で実行されるので、
81 実際には
82 .I offset
83 はページ境界に切り下げられ、読み込みバイト数は
84 .I "(offset+count)"
85 より小さくない次のページ境界まで切り上げられる。
86 .\"O .BR readahead ()
87 .\"O does not read beyond the end of the file.
88 .\"O .BR readahead ()
89 .\"O blocks until the specified data has been read.
90 .BR readahead ()
91 はファイルの末尾を越えた範囲まで読み出しを行うことはない。また、
92 .BR readahead ()
93 は指定したデータの読み込みが終わるまで停止 (block) する。
94 .\"O The current file offset of the open file referred to by
95 .\"O .I fd
96 .\"O is left unchanged.
97 .I fd
98 で参照されたオープン済のファイルのファイルオフセットの現在値は
99 変更されない。
100 .\"O .SH "RETURN VALUE"
101 .SH 返り値
102 .\"O On success,
103 .\"O .BR readahead ()
104 .\"O returns 0; on failure, \-1 is returned, with
105 .\"O .I errno
106 .\"O set to indicate the cause of the error.
107 .BR readahead ()
108 は成功すると 0 を返す。失敗した場合 \-1 を返し、
109 .I errno
110 にエラーの原因を示す値を設定する。
111 .\"O .SH ERRORS
112 .SH エラー
113 .TP
114 .B EBADF
115 .\"O .I fd
116 .\"O is not a valid file descriptor or is not open for reading.
117 .I fd
118 が有効なファイル・ディスクリプタでない、または
119 読み込み用にオープンされていない。
120 .TP
121 .B EINVAL
122 .\"O .I fd
123 .\"O does not refer to a file type to which
124 .\"O .BR readahead ()
125 .\"O can be applied.
126 .I fd
127 が参照しているファイルが、
128 .BR readahead ()
129 を行うことができないタイプのファイルであった。
130 .\"O .SH VERSIONS
131 .SH バージョン
132 .\"O The
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.
136 .BR readahead ()
137 システムコールは Linux 2.4.13 で登場した。
138 glibc でのサポートは glibc バージョン 2.3 以降で行われている。
139 .\"O .SH "CONFORMING TO"
140 .SH 準拠
141 .\"O The
142 .\"O .BR readahead ()
143 .\"O system call is Linux-specific, and its use should be avoided
144 .\"O in portable applications.
145 .BR readahead ()
146 システムコールは Linux 固有であり、移植を考慮したプログラムでは
147 使用を避けるべきである。
148 .\"O .SH "SEE ALSO"
149 .SH 関連項目
150 .BR lseek (2),
151 .BR madvise (2),
152 .BR mmap (2),
153 .BR posix_fadvise (2),
154 .BR read (2)