Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
fseeko64(3) OSS Library Calls Reference Manual
NAME
fseeko64 - 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 fseeko64(
FILE ∗∗stream,
off64_t offset,
int whence);
PARAMETERS
stream Specifies the I/O stream.
offset Determines the position of the next operation.
whence Determines the value for the file pointer associated with the stream parameter.
DESCRIPTION
The fseeko64( ) function is identical to the fseek( ) function except that its return value is of type
off64_t.
An application can explicitly call this function you compile the application using the #define
_LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command option.
An application call to fseek( ) or to fseeko( ) 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 fseeko64( ) function sets the position of the next input or output operation on the I/O stream
specified by the stream parameter. The offset parameter, which can be either positive or negative,
determines the position of the next operation.
The fseeko64( ) function sets the file pointer associated with the specified stream as follows:
• If the whence parameter is SEEK_SET, the pointer is set to the value of the offset
parameter.
• If the whence parameter is SEEK_CUR, the pointer is set to its current location plus the
value of the offset parameter.
• If the whence parameter is SEEK_END, the pointer is set to the size of the file plus the
value of the offset parameter.
The fseeko64( ) function fails if attempted on a file that was not opened with the fopen( ) func-
tion. In particular, you cannot use the fseeko() function on a terminal or on a file opened with
the popen( ) function.
A successful call to the fseeko64( ) function clears the End-of-File indicator for the stream and
undoes any effects of the ungetc( ) function on the same stream. After a call to the fseeko64( )
function, the next operation on an update stream can be either input or output.
If the stream is writable, and buffered data was not written to the underlying file, the fseeko64( )
function causes the unwritten data to be written to the file and marks the st_ctime and st_mtime
2−184 Hewlett-Packard Company 527187-017