1POSIX_FADVISE(3P) POSIX Programmer's Manual POSIX_FADVISE(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 posix_fadvise - file advisory information (ADVANCED REALTIME)
13
15 #include <fcntl.h>
16
17 int posix_fadvise(int fd, off_t offset, size_t len, int advice);
18
19
21 The posix_fadvise() function shall advise the implementation on the
22 expected behavior of the application with respect to the data in the
23 file associated with the open file descriptor, fd, starting at offset
24 and continuing for len bytes. The specified range need not currently
25 exist in the file. If len is zero, all data following offset is speci‐
26 fied. The implementation may use this information to optimize handling
27 of the specified data. The posix_fadvise() function shall have no
28 effect on the semantics of other operations on the specified data,
29 although it may affect the performance of other operations.
30
31 The advice to be applied to the data is specified by the advice parame‐
32 ter and may be one of the following values:
33
34 POSIX_FADV_NORMAL
35
36 Specifies that the application has no advice to give on its
37 behavior with respect to the specified data. It is the default
38 characteristic if no advice is given for an open file.
39
40 POSIX_FADV_SEQUENTIAL
41
42 Specifies that the application expects to access the specified
43 data sequentially from lower offsets to higher offsets.
44
45 POSIX_FADV_RANDOM
46
47 Specifies that the application expects to access the specified
48 data in a random order.
49
50 POSIX_FADV_WILLNEED
51
52 Specifies that the application expects to access the specified
53 data in the near future.
54
55 POSIX_FADV_DONTNEED
56
57 Specifies that the application expects that it will not access
58 the specified data in the near future.
59
60 POSIX_FADV_NOREUSE
61
62 Specifies that the application expects to access the specified
63 data once and then not reuse it thereafter.
64
65
66 These values are defined in <fcntl.h>.
67
69 Upon successful completion, posix_fadvise() shall return zero; other‐
70 wise, an error number shall be returned to indicate the error.
71
73 The posix_fadvise() function shall fail if:
74
75 EBADF The fd argument is not a valid file descriptor.
76
77 EINVAL The value of advice is invalid.
78
79 ESPIPE The fd argument is associated with a pipe or FIFO.
80
81
82 The following sections are informative.
83
85 None.
86
88 The posix_fadvise() function is part of the Advisory Information option
89 and need not be provided on all implementations.
90
92 None.
93
95 None.
96
98 posix_madvise(), the Base Definitions volume of IEEE Std 1003.1-2001,
99 <fcntl.h>
100
102 Portions of this text are reprinted and reproduced in electronic form
103 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
104 -- Portable Operating System Interface (POSIX), The Open Group Base
105 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
106 Electrical and Electronics Engineers, Inc and The Open Group. In the
107 event of any discrepancy between this version and the original IEEE and
108 The Open Group Standard, the original IEEE and The Open Group Standard
109 is the referee document. The original Standard can be obtained online
110 at http://www.opengroup.org/unix/online.html .
111
112
113
114IEEE/The Open Group 2003 POSIX_FADVISE(3P)