220 lines
9.8 KiB
HTML
220 lines
9.8 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>fsetpos</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="fsetpos"></a> <a name="tag_03_192"></a><!-- fsetpos -->
|
|
<!--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_192_01"></a>NAME</h4>
|
|
|
|
<blockquote>fsetpos - set current file position</blockquote>
|
|
|
|
<h4><a name="tag_03_192_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<p><code><tt>#include <<a href="../basedefs/stdio.h.html">stdio.h</a>><br>
|
|
<br>
|
|
int fsetpos(FILE *</tt><i>stream</i><tt>, const fpos_t *</tt><i>pos</i><tt>);<br>
|
|
</tt></code></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"
|
|
border="0"> The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the
|
|
requirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers to
|
|
the ISO C standard. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div>
|
|
|
|
<p>The <i>fsetpos</i>() function shall set the file position and state indicators for the stream pointed to by <i>stream</i>
|
|
according to the value of the object pointed to by <i>pos</i>, which the application shall ensure is a value obtained from an
|
|
earlier call to <a href="../functions/fgetpos.html"><i>fgetpos</i>()</a> on the same stream. If a read or write error occurs, the
|
|
error indicator for the stream shall be set and <i>fsetpos</i>() fails.</p>
|
|
|
|
<p>A successful call to the <i>fsetpos</i>() function shall clear the end-of-file indicator for the stream and undo any effects of
|
|
<a href="../functions/ungetc.html"><i>ungetc</i>()</a> on the same stream. After an <i>fsetpos</i>() call, the next operation on an
|
|
update stream may be either input or output.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> The
|
|
behavior of <i>fsetpos</i>() on devices which are incapable of seeking is implementation-defined. The value of the file offset
|
|
associated with such a device is undefined. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>fsetpos</i>() function shall return 0 if it succeeds; otherwise, it shall return a non-zero value and set <i>errno</i> to
|
|
indicate the error.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>fsetpos</i>() function shall fail if, <sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src=
|
|
"../images/opt-start.gif" alt="[Option Start]" border="0"> either the <i>stream</i> is unbuffered or the <i>stream</i>'s
|
|
buffer needed to be flushed, and the call to <i>fsetpos</i>() causes an underlying <a href=
|
|
"../functions/lseek.html"><i>lseek</i>()</a> or <a href="../functions/write.html"><i>write</i>()</a> to be invoked, and: <img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
|
|
<dl compact>
|
|
<dt>[EAGAIN]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The O_NONBLOCK flag is set for the file descriptor and the process would be delayed in the write operation. <img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EBADF]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The file descriptor underlying the stream file is not open for writing or the stream's buffer needed to be flushed and the file is
|
|
not open. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EFBIG]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> An
|
|
attempt was made to write a file that exceeds the maximum file size. <img src="../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></dd>
|
|
|
|
<dt>[EFBIG]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
An attempt was made to write a file that exceeds the process' file size limit. <img src="../images/opt-end.gif" alt="[Option End]"
|
|
border="0"></dd>
|
|
|
|
<dt>[EFBIG]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding
|
|
stream. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EINTR]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The write operation was terminated due to the receipt of a signal, and no data was transferred. <img src="../images/opt-end.gif"
|
|
alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EINVAL]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The <i>whence</i> argument is invalid. The resulting file-position indicator would be set to a negative value. <img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EIO]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> A
|
|
physical I/O error has occurred, or the process is a member of a background process group attempting to perform a <a href=
|
|
"../functions/write.html"><i>write</i>()</a> to its controlling terminal, TOSTOP is set, the process is neither ignoring nor
|
|
blocking SIGTTOU, and the process group of the process is orphaned. This error may also be returned under implementation-defined
|
|
conditions. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[ENOSPC]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
There was no free space remaining on the device containing the file. <img src="../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></dd>
|
|
|
|
<dt>[ENXIO]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> A
|
|
request was made of a nonexistent device, or the request was outside the capabilities of the device. <img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt>[EPIPE]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The file descriptor underlying <i>stream</i> is associated with a pipe or FIFO. <img src="../images/opt-end.gif" alt="[Option End]"
|
|
border="0"></dd>
|
|
|
|
<dt>[EPIPE]</dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> An
|
|
attempt was made to write to a pipe or FIFO that is not open for reading by any process; a SIGPIPE signal shall also be sent to the
|
|
thread. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_192_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="fopen.html"><i>fopen</i>()</a> , <a href="ftell.html"><i>ftell</i>()</a> , <a href="lseek.html"><i>lseek</i>()</a> , <a
|
|
href="rewind.html"><i>rewind</i>()</a> , <a href="ungetc.html"><i>ungetc</i>()</a> , <a href="write.html"><i>write</i>()</a> , the
|
|
Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/stdio.h.html"><i><stdio.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4. Derived from the ISO C standard.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_192_12"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>Extensions beyond the ISO C standard are marked.</p>
|
|
|
|
<p>An additional [ESPIPE] error condition is added for sockets.</p>
|
|
|
|
<p>The DESCRIPTION is updated to avoid use of the term "must" for application requirements.</p>
|
|
|
|
<p>The DESCRIPTION is updated to clarify that the error indicator is set for the stream on a read or write error. This is for
|
|
alignment with the ISO/IEC 9899:1999 standard.</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>
|
|
|