readaheadのヘルプ・マニュアル
日本語 英語
readahead --help
readahead [?????] ???> [...]
-s | --sort ????????????
-o | --output ???> ????????????????
-d | --dont-sort ?????????????? readahead(2) ?????
-h | --help ?????
-v | --verbose ?????
-t | --timing ???????????
-m | --maxsize <10240> ?????????????????? (KiB?)
readahead [options] [...]
-s | --sort sort list of files only
-o | --output output sorted list of files
-d | --dont-sort call readahead(2) for already sorted list
-h | --help this help
-v | --verbose verbose mode
-t | --timing report wasted time
-m | --maxsize <10240> max size of a file to be preloaded (in KiB)
man readahead
READAHEAD(2) Linux Programmer’s Manual READAHEAD(2)
名前
readahead - 前もってファイルをページ・キャッシュに読み込む
書式
#define _GNU_SOURCE
#include
ssize_t readahead(int fd, off64_t offset, size_t count);
説明
readahead() は 、この後の同じファイルからのデータ読み込み時にディスク
I/O で動作が停止 (block) しないように、前もってファイルの内容をページ・
キ ャッシュに読み込む。 fd 引き数は読み込みを行うファイルを識別するファ
イル・ディスクリプタである。 offset 引き数はデータの読み込み開始位置 を
指 定し、 count は読み込むデータのバイト数を指定する。ディスク I/O はペ
ージ単位で実行されるので、実際には offset はページ境界に切り下げられ 、
読 み込みバイト数は (offset+count) より小さくない次のページ境界まで切り
上げられる。 readahead() はファイルの末尾を越えた範囲まで読み出しを行う
ことはない。また、 readahead() は指定したデータの読み込みが終わるまで停
止 (block) する。 fd で参照されたオープン済のファイルのファイルオフセッ
トの現在値は変更されない。
返り値
readahead() は成功すると 0 を返す。失敗した場合 -1 を返し、 errno にエ
ラーの原因を示す値を設定する。
エラー
EBADF fd が有効なファイル・ディスクリプタでない、または読み込み用に オ
ープンされていない。
EINVAL fd が参照しているファイルが、 readahead() を行うことができないタ
イプのファイルであった。
バージョン
readahead() システムコールは Linux 2.4.13 で登場した。 glibc でのサポー
トは glibc バージョン 2.3 以降で行われている。
準拠
readahead() システムコールは Linux 固有であり、移植を考慮したプログラム
では使用を避けるべきである。
関連項目
lseek(2), madvise(2), mmap(2), posix_fadvise(2), read(2)
Linux 2007-07-26 READAHEAD(2)
READAHEAD(2) Linux Programmer’s Manual READAHEAD(2)
NAME
readahead - perform file readahead into page cache
SYNOPSIS
#define _GNU_SOURCE
#include
ssize_t readahead(int fd, off64_t offset, size_t count);
DESCRIPTION
readahead() populates the page cache with data from a file so that sub-
sequent reads from that file will not block on disk I/O. The fd argu-
ment is a file descriptor identifying the file which is to be read.
The offset argument specifies the starting point from which data is to
be read and count specifies the number of bytes to be read. I/O is
performed in whole pages, so that offset is effectively rounded down to
a page boundary and bytes are read up to the next page boundary greater
than or equal to (offset+count). readahead() does not read beyond the
end of the file. readahead() blocks until the specified data has been
read. The current file offset of the open file referred to by fd is
left unchanged.
RETURN VALUE
On success, readahead() returns 0; on failure, -1 is returned, with
errno set to indicate the cause of the error.
ERRORS
EBADF fd is not a valid file descriptor or is not open for reading.
EINVAL fd does not refer to a file type to which readahead() can be
applied.
VERSIONS
The readahead() system call appeared in Linux 2.4.13; glibc support has
been provided since version 2.3.
CONFORMING TO
The readahead() system call is Linux-specific, and its use should be
avoided in portable applications.
SEE ALSO
lseek(2), madvise(2), mmap(2), posix_fadvise(2), read(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2007-07-26 READAHEAD(2)