Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

fgetpos64(3) OSS Library Calls Reference Manual
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 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 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.
266 Hewlett-Packard Company 527187-017