Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
fgetpos(3) Guardian Native C Library Calls Reference Manual
NAME
fgetpos - Reposition 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 fgetpos(
FILE *stream,
fpos_t *position);
PARAMETERS
stream Specifies the I/O stream.
position Specifies 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. Thefsetpos( ) function sets the file 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 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: fopen(3), fseek(3), fsetpos(3), ftell(3), rewind(3).
2−16 Hewlett-Packard Company 527192-005