Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (f) fgetpos64(3)
NAME
fgetpos64 - 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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
int fgetpos64(
FILE *stream,
fpos64_t *position);
PARAMETERS
stream Specifies the I/O stream.
position Specifies the value of the file position indicator.
DESCRIPTION
The fgetpos64() function is similar to the fgetpos( ) function except that, in addition to support-
ing smaller files, the fgetpos64() function supports OSS files larger than approximately 2 giga-
bytes and Guardian files larger than approximatly 4 gigabytes.
An application can explicitly call this function when you compile the application using the
#define _LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command
option.
An application call to fgetpos() is automatically mapped to this function when you compile the
application using the #define _FILE_OFFSET_BITS 64 feature test macro or an equivalent
compiler command option.
The fgetpos64() function is similar to the fseek() function. The fgetpos64() 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 fgetpos64()
function.
RETURN VALUES
Upon successful completion, the fgetpos64() function returns a value of 0 (zero). If the fget-
pos64() function fails, a value of -1 is returned, and errno is set to [EINVAL].
ERRORS
If any of these conditions occurs, the fgetpos64() 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 is greater than or equal to the file offset maximum.
[ESPIPE] An illegal attempt was made to get or set the file position of a pipe or FIFO.
527192-007 Hewlett-Packard Company 2−17