Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

fgetpos(3) OSS Library Calls Reference Manual
NAME
fgetpos - Reposition the le 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 fgetpos(
FILE *stream,
fpos_t *position);
PARAMETERS
stream Species the I/O stream.
position Species the value of the le position indicator.
DESCRIPTION
The fgetpos() function is similar to the fseek() function. The fgetpos() function stores the
current value of the le position indicator for the stream pointed to by the stream parameter in
the object pointed to by the position parameter. Thefsetpos() function sets the le position indi-
cator according to the value of the position parameter, returned by a prior call to the fgetpos()
function.
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 errno is set to [EINVAL].
ERRORS
If the following conditions occur, the fgetpos( ) sets errno to the corresponding value:
[EBADF] The le descriptor underlying the stream parameter is not a valid le descriptor.
[ESPIPE] An illegal attempt was made to get or set the le position of a pipe or FIFO.
RELATED INFORMATION
Functions: fopen(3), fseek(3), fsetpos(3), ftell(3), rewind(3).
236 Hewlett-Packard Company 527187-004