Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

fgetpos(3) OSS Library Calls Reference Manual
NAME
fgetpos - Repositions 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. The fsetpos() function sets the le 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 le descriptor underlying the stream parameter is not a valid le descriptor.
[EFBIG] The buffers of the stream need to be ushed, and the starting point is greater than |
or equal to the le offset maximum.
[EOVERFLOW]
The value of the le position cannot be represented in an object of type fpos_t.|
[ESPIPE] An illegal attempt was made to get or set the le 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 specication.
236 Hewlett-Packard Company 527187-007