1 .\" This manpage is Copyright (C) 2004, Michael Kerrisk
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" 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 .TH READAHEAD 2 2010-09-10 "Linux" "Linux Programmer's Manual"
30 readahead \- perform file readahead into page cache
33 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
36 .BI "ssize_t readahead(int " fd ", off64_t " offset ", size_t " count );
40 populates the page cache with data from a file so that subsequent
41 reads from that file will not block on disk I/O.
44 argument is a file descriptor identifying the file which is
48 argument specifies the starting point from which data is to be read
51 specifies the number of bytes to be read.
52 I/O is performed in whole pages, so that
54 is effectively rounded down to a page boundary
55 and bytes are read up to the next page boundary greater than or
57 .IR "(offset+count)" .
59 does not read beyond the end of the file.
61 blocks until the specified data has been read.
62 The current file offset of the open file referred to by
68 returns 0; on failure, \-1 is returned, with
70 set to indicate the cause of the error.
75 is not a valid file descriptor or is not open for reading.
79 does not refer to a file type to which
85 system call appeared in Linux 2.4.13;
86 glibc support has been provided since version 2.3.
90 system call is Linux-specific, and its use should be avoided
91 in portable applications.
96 .BR posix_fadvise (2),