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

Guardian Native C Library Calls (f) fsetpos(3)
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 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>
int fsetpos(
FILE *stream,
const fpos_t *position);
PARAMETERS
stream Species the I/O stream.
position Species the value of the file position indicator.
DESCRIPTION
The fsetpos( ) function is similar to the ftell( ) function The fsetpos() 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 End-of-File 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 these conditions occurs, the fsetpos() function sets errno to the corresponding value:
[EBADF] The file descriptor underlying the stream parameter is not a valid file descriptor.
[EFBIG] The buffers of the stream need to be flushed, and the starting point is greater than
or equal to the file offset maximum.
[EOVERFLOW]
The value of position could not be represented in an object of type fpos_t.
[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), fsetpos64(3), ftell(3), rewind(3).
STANDARDS CONFORMANCE
The [EFBIG] and [EOVERFLOW] errno values are HP extensions to the XPG4 specication.
527192-018 Hewlett-Packard Company 2145