2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
44 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
46 .TH POSIX_FADVISE 3C "Jul 14, 2008"
48 posix_fadvise \- file advisory information
54 \fBint\fR \fBposix_fadvise\fR(\fBint\fR \fIfd\fR, \fBoff_t\fR \fIoffset\fR, \fBoff_t\fR \fIlen\fR, \fBint\fR \fIadvice\fR);
60 The \fBposix_fadvise()\fR function advises the system on the expected behavior
61 of the application with respect to the data in the file associated with the
62 open file descriptor, \fIfd\fR, starting at \fIoffset\fR and continuing for
63 \fIlen\fR bytes. The specified range need not currently exist in the file. If
64 \fIlen\fR is zero, all data following offset is specified. The system may use
65 this information to optimize handling of the specified data. The
66 \fBposix_fadvise()\fR function has no effect on the semantics of other
67 operations on the specified data, although it may affect the performance of
71 The advice to be applied to the data is specified by the \fIadvice\fR parameter
72 and may be one of the following values:
76 \fB\fBPOSIX_FADV_NORMAL\fR\fR
79 Specifies that the application has no advice to give on its behavior with
80 respect to the specified data. It is the default characteristic if no advice is
81 given for an open file.
87 \fB\fBPOSIX_FADV_SEQUENTIAL\fR\fR
90 Specifies that the application expects to access the specified data
91 sequentially from lower offsets to higher offsets.
97 \fB\fBPOSIX_FADV_RANDOM\fR\fR
100 Specifies that the application expects to access the specified data in a random
107 \fB\fBPOSIX_FADV_WILLNEED\fR\fR
110 Specifies that the application expects to access the specified data in the near
117 \fB\fBPOSIX_FADV_DONTNEED\fR\fR
120 Specifies that the application expects that it will not access the specified
121 data in the near future.
127 \fB\fBPOSIX_FADV_NOREUSE\fR\fR
130 Specifies that the application expects to access the specified data once and
131 then not reuse it thereafter.
136 These values are defined in \fB<fcntl.h>\fR
140 Upon successful completion, \fBposix_fadvise()\fR returns zero. Otherwise, an
141 error number is returned to indicate the error.
145 The \fBposix_fadvise()\fR function will fail if:
152 The \fIfd\fR argument is not a valid file descriptor.
161 The value of \fIadvice\fR is invalid, or the value of \fIlen\fR is less than
171 The \fIfd\fR argument is associated with a pipe or FIFO.
177 The \fBposix_fadvise()\fR function has a transitional interface for 64-bit file
178 offsets. See \fBlf64\fR(5).
182 See \fBattributes\fR(5) for descriptions of the following attributes:
190 ATTRIBUTE TYPE ATTRIBUTE VALUE
192 Interface Stability Committed
196 Standard See \fBstandards\fR(5).
202 \fBposix_madvise\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)