Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (n - r) rewind(3)
NAME
rewind - Repositions the file pointer of a stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
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
flushed 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 flag is set for the file descriptor underlying the stream
parameter and the process would be delayed in the write operation.
[EBADF] The file descriptor underlying the stream parameter is not a valid file descriptor
open for writing.
[EFBIG] An attempt was made to write to a file that exceeds the processs file size limit or
the maximum file 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
fflush() 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 file.
[ENXIO] A request was made to a nonexistent device, or the request was outside the capa-
bilities of the device.
527192-018 Hewlett-Packard Company 5123