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

fgetpos(3) Guardian Native C Library Calls Reference Manual
NAME
fgetpos - 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 fgetpos(
FILE *stream,
fpos_t *position);
PARAMETERS
stream Species the I/O stream.
position Species the value of the file position indicator.
DESCRIPTION
The fgetpos( ) function is similar to the fseek() function. The fgetpos() function stores the
current value of the file position indicator for the stream pointed to by the stream parameter in
the object pointed to by the position parameter. The fsetpos() function sets the file position indi-
cator according to the value of the position parameter, returned by a prior call to the fgetpos()
function.
Use From the Guardian Environment
RETURN VALUES
Upon successful completion, the fgetpos() function returns a value of 0 (zero). If the fgetpos( )
function fails, a value of -1 is returned, and sets errno to [EINVAL].
ERRORS
If any of these conditions occurs, the fgetpos() 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 the file position cannot 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: fgetpos64(3), fopen(3), fseek(3), fsetpos(3), ftell(3), rewind(3).
STANDARDS CONFORMANCE
The [EFBIG] errno value is an HP extension to the XPG4 specification.
232 Hewlett-Packard Company 527192-018