Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

OSS Library Calls (e - f) fseeko(3)
reect the location specied by the fseeko() function.
The fseeko() function allows the le-position indicator to be set beyond the end of existing data
in the le. 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 fseeko() function
does not, by itself, extend the size of a le.
Information About Guardian EDIT Files
If called from a native process, the fseeko() function can operate on Guardian EDIT les (type
101 les). The behavior of this function differs according to whether the le is opened with a
Guardian connection or with an OSS connection.
To operate on a Guardian EDIT le using a Guardian connection to that le, 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 le using a Guardian connection, a call to the
fseeko() function implements a position operation as if an equivalent call were being made to the
edfseeko() function.
To operate on a Guardian EDIT le 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 le using an OSS connection, calls to the fseeko()
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 fseeko() function returns a value of 0 (zero). If the fseeko()
function fails, a value of -1 is returned, and errno is set to indicate the error.
ERRORS
The fseeko() function fails if either the stream is unbuffered, or the streams buffer needed to be
ushed and the call to fseeko() caused an underlying lseek() or write() function to be invoked.
In addition, if any of these conditions occurs, the fseeko() function sets errno to the correspond-
ing value.
[EAGAIN] The O_NONBLOCK ag is set for the le descriptor underlying the stream
parameter, and the process is in the write operation.
[EBADF] The le descriptor underlying the stream parameter is not a valid le descriptor
open for writing.
[EFBIG] The buffers of the stream need to be ushed, and the starting point is greater than
or equal to an offset of 2 gigabytes. The le offset maximum for this function,
for both OSS les and Guardian les, is 2 gigabytes.
[EINTR] A signal terminated the write operation, and either none, some, or all the data
was transferred. If there is buffered I/O, call the fush() function before the
fseeko() function to guarantee that the buffer characters are written.
527187-007 Hewlett-Packard Company 2127