Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

rewind(3) Guardian Native C Library Calls Reference Manual
NAME
rewind - Repositions the le pointer of a stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
void rewind(
FILE stream);
PARAMETERS
stream Species the I/O stream.
DESCRIPTION
The rewind() function is equivalent to (void) fseek (stream, 0L, SEEK_SET), except that it also
clears the error indicator.
RETURN VALUES
The rewind() function does not return a value.
ERRORS
The rewind() function fails if either the stream is unbuffered, or the streams buffer needed to be
ushed and the call caused an underlying lseek() or write() function to be invoked. In addition,
if any of the following conditions occurs, the rewind() function sets errno to the corresponding
value:
[EAGAIN] The O_NONBLOCK ag is set for the le descriptor underlying the stream
parameter and the process would be delayed in the write operation.
[EBADF] The le descriptor underlying the stream parameter is not a valid le descriptor
open for writing.
[EFBIG] An attempt was made to write to a le that exceeds the processs le size limit or
the maximum le size.
[EINTR] The write operation was terminated by a signal, and either none, some, or all the
data was transferred. If there is buffered I/O, it is recommended that you call the
fush( ) function before the rewind() function to guarantee that the buffer char-
acters were written.
[EIO] The process is a member of a background process group attempting to write to its
controlling terminal, the TOSTOP signal is set, the process is neither ignoring
nor blocking SIGTTOU, and the process group of the process is orphaned.
[ENOSPC] There was no free space remaining on the device containing the le.
[ENXIO] A request was made to a nonexistent device, or the request was outside the capa-
bilities of the device.
[EPIPE] An attempt was made to write to a pipe or FIFO that is not open for reading by
any process. A SIGPIPE signal is also sent to the process.
578 Hewlett-Packard Company 527192-005