173 lines
5.7 KiB
HTML
173 lines
5.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>posix_fadvise</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="posix_fadvise"></a> <a name="tag_03_421"></a><!-- posix_fadvise -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_421_01"></a>NAME</h4>
|
|
|
|
<blockquote>posix_fadvise - file advisory information (<b>ADVANCED REALTIME</b>)</blockquote>
|
|
|
|
<h4><a name="tag_03_421_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('ADV')">ADV</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <<a href="../basedefs/fcntl.h.html">fcntl.h</a>><br>
|
|
<br>
|
|
int posix_fadvise(int</tt> <i>fd</i><tt>, off_t</tt> <i>offset</i><tt>, size_t</tt> <i>len</i><tt>, int</tt> <i>advice</i><tt>);
|
|
<img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_03_421_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>posix_fadvise</i>() function shall advise the implementation on the expected behavior of the application with respect to
|
|
the data in the file associated with the open file descriptor, <i>fd</i>, starting at <i>offset</i> and continuing for <i>len</i>
|
|
bytes. The specified range need not currently exist in the file. If <i>len</i> is zero, all data following <i>offset</i> is
|
|
specified. The implementation may use this information to optimize handling of the specified data. The <i>posix_fadvise</i>()
|
|
function shall have no effect on the semantics of other operations on the specified data, although it may affect the performance of
|
|
other operations.</p>
|
|
|
|
<p>The advice to be applied to the data is specified by the <i>advice</i> parameter and may be one of the following values:</p>
|
|
|
|
<dl compact>
|
|
<dt>POSIX_FADV_NORMAL</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application has no advice to give on its behavior with respect to the specified data. It is the default
|
|
characteristic if no advice is given for an open file.</dd>
|
|
|
|
<dt>POSIX_FADV_SEQUENTIAL</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application expects to access the specified data sequentially from lower offsets to higher offsets.</dd>
|
|
|
|
<dt>POSIX_FADV_RANDOM</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application expects to access the specified data in a random order.</dd>
|
|
|
|
<dt>POSIX_FADV_WILLNEED</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application expects to access the specified data in the near future.</dd>
|
|
|
|
<dt>POSIX_FADV_DONTNEED</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application expects that it will not access the specified data in the near future.</dd>
|
|
|
|
<dt>POSIX_FADV_NOREUSE</dt>
|
|
|
|
<dd><br>
|
|
Specifies that the application expects to access the specified data once and then not reuse it thereafter.</dd>
|
|
</dl>
|
|
|
|
<p>These values are defined in <a href="../basedefs/fcntl.h.html"><i><fcntl.h></i></a>.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>Upon successful completion, <i>posix_fadvise</i>() shall return zero; otherwise, an error number shall be returned to indicate
|
|
the error.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>posix_fadvise</i>() function shall fail if:</p>
|
|
|
|
<dl compact>
|
|
<dt>[EBADF]</dt>
|
|
|
|
<dd>The <i>fd</i> argument is not a valid file descriptor.</dd>
|
|
|
|
<dt>[EINVAL]</dt>
|
|
|
|
<dd>The value of <i>advice</i> is invalid.</dd>
|
|
|
|
<dt>[ESPIPE]</dt>
|
|
|
|
<dd>The <i>fd</i> argument is associated with a pipe or FIFO.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_421_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>posix_fadvise</i>() function is part of the Advisory Information option and need not be provided on all
|
|
implementations.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="posix_madvise.html"><i>posix_madvise</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a
|
|
href="../basedefs/fcntl.h.html"><i><fcntl.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_421_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 6. Derived from IEEE Std 1003.1d-1999.</p>
|
|
|
|
<p>In the SYNOPSIS, the inclusion of <a href="../basedefs/sys/types.h.html"><i><sys/types.h></i></a> is no longer
|
|
required.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|