8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / man / man3c / posix_fadvise.3c
blob35066166754056ac586d9e2e8400835696d360ce
1 '\" te
2 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
3 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 .\"  This notice shall appear on any product containing this material.
8 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
10 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
11 .TH POSIX_FADVISE 3C "Jul 14, 2008"
12 .SH NAME
13 posix_fadvise \- file advisory information
14 .SH SYNOPSIS
15 .LP
16 .nf
17 #include <fcntl.h>
19 \fBint\fR \fBposix_fadvise\fR(\fBint\fR \fIfd\fR, \fBoff_t\fR \fIoffset\fR, \fBoff_t\fR \fIlen\fR, \fBint\fR \fIadvice\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBposix_fadvise()\fR function advises the system on the expected behavior
26 of the application with respect to the data in the file associated with the
27 open file descriptor, \fIfd\fR, starting at \fIoffset\fR and continuing for
28 \fIlen\fR bytes. The specified range need not currently exist in the file. If
29 \fIlen\fR is zero, all data following offset is specified. The system may use
30 this information to optimize handling of the specified data. The
31 \fBposix_fadvise()\fR function has no effect on the semantics of other
32 operations on the specified data, although it may affect the performance of
33 other operations.
34 .sp
35 .LP
36 The advice to be applied to the data is specified by the \fIadvice\fR parameter
37 and may be one of the following values:
38 .sp
39 .ne 2
40 .na
41 \fB\fBPOSIX_FADV_NORMAL\fR\fR
42 .ad
43 .RS 25n
44 Specifies that the application has no advice to give on its behavior with
45 respect to the specified data. It is the default characteristic if no advice is
46 given for an open file.
47 .RE
49 .sp
50 .ne 2
51 .na
52 \fB\fBPOSIX_FADV_SEQUENTIAL\fR\fR
53 .ad
54 .RS 25n
55 Specifies that the application expects to access the specified data
56 sequentially from lower offsets to higher offsets.
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\fBPOSIX_FADV_RANDOM\fR\fR
63 .ad
64 .RS 25n
65 Specifies that the application expects to access the specified data in a random
66 order.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fBPOSIX_FADV_WILLNEED\fR\fR
73 .ad
74 .RS 25n
75 Specifies that the application expects to access the specified data in the near
76 future.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBPOSIX_FADV_DONTNEED\fR\fR
83 .ad
84 .RS 25n
85 Specifies that the application expects that it will not access the specified
86 data in the near future.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fBPOSIX_FADV_NOREUSE\fR\fR
93 .ad
94 .RS 25n
95 Specifies that the application expects to access the specified data once and
96 then not reuse it thereafter.
97 .RE
99 .sp
101 These values are defined in \fB<fcntl.h>\fR
102 .SH RETURN VALUES
105 Upon successful completion, \fBposix_fadvise()\fR returns zero. Otherwise, an
106 error number is returned to indicate the error.
107 .SH ERRORS
110 The \fBposix_fadvise()\fR function will fail if:
112 .ne 2
114 \fB\fBEBADF\fR\fR
116 .RS 10n
117 The \fIfd\fR argument is not a valid file descriptor.
121 .ne 2
123 \fB\fBEINVAL\fR\fR
125 .RS 10n
126 The value of \fIadvice\fR is invalid, or the value of \fIlen\fR is less than
127 zero.
131 .ne 2
133 \fB\fBESPIPE\fR\fR
135 .RS 10n
136 The \fIfd\fR argument is associated with a pipe or FIFO.
139 .SH USAGE
142 The \fBposix_fadvise()\fR function has a transitional interface for 64-bit file
143 offsets. See \fBlf64\fR(5).
144 .SH ATTRIBUTES
147 See \fBattributes\fR(5) for descriptions of the following attributes:
152 box;
153 c | c
154 l | l .
155 ATTRIBUTE TYPE  ATTRIBUTE VALUE
157 Interface Stability     Committed
159 MT-Level        MT-Safe
161 Standard        See \fBstandards\fR(5).
164 .SH SEE ALSO
167 \fBposix_madvise\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)