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.
19 .\" Formatted or processed versions of this manual, if unaccompanied by
20 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" 2004-05-40 Created by Michael Kerrisk <mtk-manpages@gmx.net>
23 .\" 2004-10-05 aeb, minor correction
25 .TH READAHEAD 2 2004-10-05 "Linux 2.6.5" "Linux Programmer's Manual"
27 readahead \- perform file readahead into page cache
32 .BI "ssize_t readahead(int " fd ", off64_t *" offset ", size_t " count );
36 populates the page cache with data from a file so that subsequent
37 reads from that file will not block on disk I/O.
40 argument is a file descriptor identifying the file which is
44 argument specifies the starting point from which data is to be read
47 specifies the number of bytes to be read.
48 I/O is performed in whole pages, so that
50 is effectively rounded down to a page boundary
51 and bytes are read up to the next page boundary greater than or
53 .IR "(offset+count)" .
55 does not read beyond the end of the file.
57 blocks until the specified data has been read.
58 The current file offset of the open file referred to by
64 returns 0; on failure, \-1 is returned, with
66 set to indicate the cause of the error.
71 is not a valid file descriptor or is not open for reading.
75 does not refer to a file type to which
81 system call is Linux specific, and its use should be avoided
82 in portable applications.
86 system call appeared in Linux 2.4.13.
92 .BR posix_fadvise (2),