Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2017
 
 

rewind(3C)

Name

rewind - reset file position indicator in a stream

Synopsis

#include <stdio.h>

void rewind(FILE *stream);

Description

The call:

rewind(stream)

is equivalent to:

(void) fseek(stream, 0L, SEEK_SET)

except that rewind() also clears the error indicator.

Return Values

The rewind() function returns no value.

Errors

Refer to fseek(3C) with the exception of EINVAL which does not apply.

Usage

Because rewind() does not return a value, an application wishing to detect errors should clear errno, then call rewind(), and if errno is non-zero, assume an error has occurred.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe
Standard

See Also

fseek(3C), attributes(5), standards(5)