summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-19 08:24:50 +0000
committerache <ache@FreeBSD.org>2001-08-19 08:24:50 +0000
commit6ea1f5e148a92f6c2a60255b3a5bf9c49f2c5793 (patch)
treedb330589e130de92889000694518c35e6f5429f1
parent5e75b336b9d01ea2b70ff9f4098ca7e54f86975a (diff)
downloadFreeBSD-src-6ea1f5e148a92f6c2a60255b3a5bf9c49f2c5793.zip
FreeBSD-src-6ea1f5e148a92f6c2a60255b3a5bf9c49f2c5793.tar.gz
Add about rewind+errno, describe ESPIPE, minor formatting.
-rw-r--r--lib/libc/stdio/fseek.329
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/libc/stdio/fseek.3 b/lib/libc/stdio/fseek.3
index d7c8086..73a79f2 100644
--- a/lib/libc/stdio/fseek.3
+++ b/lib/libc/stdio/fseek.3
@@ -115,6 +115,17 @@ except that the error indicator for the stream is also cleared
(see
.Xr clearerr 3 ) .
.Pp
+Since
+.Fn rewind
+does not return a value,
+an application wishing to detect errors should clear
+.Va errno ,
+then call
+.Fn rewind ,
+and if
+.Va errno
+is non-zero, assume an error has occurred.
+.Pp
The
.Fn fseeko
function is identical to
@@ -168,8 +179,9 @@ and
and
.Fn ftello
return the current offset.
-Otherwise, \-1 is returned and the global variable errno is set to
-indicate the error.
+Otherwise, \-1 is returned and the global variable
+.Va errno
+is set to indicate the error.
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EBADF
@@ -180,20 +192,25 @@ is not a seekable stream.
.It Bq Er EINVAL
The
.Fa whence
-argument is invalid.
-The resulting file-position
+argument is invalid or
+the resulting file-position
indicator would be set to a negative value.
.It Bq Er EOVERFLOW
The resulting file offset would be a value which
-cannot be represented correctly in an object of type off_t
+cannot be represented correctly in an object of type
+.Fa off_t
for
.Fn fseeko
and
.Fn ftello
-or long for
+or
+.Fa long
+for
.Fn fseek
and
.Fn ftell .
+.It Bq Er ESPIPE
+The file descriptor underlying stream is associated with a pipe or FIFO.
.El
.Pp
The functions
OpenPOWER on IntegriCloud