Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
fseeko64(3) Guardian Native C Library Calls Reference Manual
If the most recent operation (ignoring any ftell() operations) on a given stream was fflush(), then
the fseeko64() function causes the file offset in the underlying open file descriptor to be adjusted
to reflect the location specified by the fseeko64() function.
The fseeko64() function allows the file-position indicator to be set beyond the end of existing
data in the file. If data is later written at this point, subsequent reads of data in the gap will return
bytes with the value 0 (zero) until data is actually written into the gap. The fseeko64() function
does not, by itself, extend the size of a file.
Information About Guardian EDIT Files
If called from a native process, the fseeko64() function can operate on Guardian EDIT files (type
101 files). The behavior of this function differs according to whether the file is opened with a
Guardian connection or with an OSS connection.
To operate on a Guardian EDIT file using a Guardian connection to that file, you must open a
stream by calling:
• fopen_guardian(), freopen_guardian(), or a similar function from any process
• fopen( ), freopen(), or a similar function from a process executing in the Guardian
environment
When the stream references a Guardian EDIT file using a Guardian connection, a call to the
fseeko64() function implements a position operation as if an equivalent call were being made to
the edfseeko64() function.
To operate on a Guardian EDIT file using an OSS connection, you must open a stream by calling:
• fopen_oss(), freopen_oss(), or a similar function from any process
• fopen( ), freopen(), or a similar function from a process executing in the OSS environ-
ment
When the stream references a Guardian EDIT file using an OSS connection, calls to the
fseeko64() function are implemented using the lseek() function. For information about the
lseek() function, see the lseek(2) reference page.
RETURN VALUES
Upon successful completion, the fseeko64() function returns a value of 0 (zero). If the
fseeko64() function fails, a value of -1 is returned, and errno is set to indicate the error.
ERRORS
The fseeko64() function fails if either the stream is unbuffered, or the stream’s buffer needed to
be flushed and the call to fseeko64() caused an underlying lseek() or write() function to be
invoked. In addition, if any of these conditions occurs, the fseeko64() function sets errno to the
corresponding value.
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying the stream
parameter, and the process is delayed in the write operation.
[EBADF] The file descriptor underlying the stream parameter is not a valid file descriptor
open for writing.
[EFBIG] The buffers of the stream need to be flushed, and the starting point is greater than
or equal to the file offset maximum.
2−102 Hewlett-Packard Company 527192-007