Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
fsetpos(3) Guardian Native C Library Calls Reference Manual
NAME
fsetpos - 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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
int fsetpos(
FILE *stream,
const fpos_t *position);
PARAMETERS
stream Specifies the I/O stream.
position Specifies the value of the file position indicator.
DESCRIPTION
The fsetpos() function is similar to the ftell() function Thefsetpos() function sets the file posi-
tion indicator according to the value of the position parameter, returned by a prior call to the
fgetpos() function.
A successful call to the fsetpos( ) function clears the EOF indicator and undoes any effects of the
ungetc() function.
RETURN VALUES
Upon successful completion, the fsetpos( ) function returns a value of 0 (zero). If the fsetpos( )
function fails, a value of -1 is returned, and errno is set to [EINVAL].
ERRORS
If the following conditions occur, the fsetpos( ) function sets errno to the corresponding value:
[EBADF] The file descriptor underlying the stream parameter is not a valid file descriptor.
[ESPIPE] An illegal attempt was made to get or set the file position of a pipe or FIFO.
RELATED INFORMATION
Functions: fgetpos(3), fopen(3), fseek(3), ftell(3), rewind(3).
2−76 Hewlett-Packard Company 527192-005