Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

fseek(3) Guardian Native C Library Calls Reference Manual
Information About Guardian EDIT Files
If called from a native process, the fseek() 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, a stream must be
opened 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
fseek() function implements a position operation as if an equivalent call were being made to the
edfseek() function.
To operate on a Guardian EDIT le using an OSS connection, a stream must be opened by cal-
ling:
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 fseek()
function are implemented using the lseek() function. Refer to the lseek(2) reference page for
information about the lseek() function.
RETURN VALUES
Upon successful completion, the fseek() function returns a value of 0 (zero). If the fseek() func-
tion fails, a value of -1 is returned, and errno is set to indicate the error.
ERRORS
The fseek() function fails if either the stream is unbuffered, or the streams buffer needed to be
ushed and the call to fseek() caused an underlying lseek() or write() function to be invoked.
In addition, if any of the following conditions occurs, the fseek() function sets errno to the value
that corresponds to the condition.
[EAGAIN] The O_NONBLOCK ag is set for the le descriptor underlying the stream
parameter and the process would be delayed in the write operation.
[EBADF] The le descriptor underlying the stream parameter is not a valid le descriptor
open for writing.
[EFBIG] An attempt was made to write to a le that exceeds the processs le size limit or
the maximum le size.
[EINTR] The write operation was terminated by a signal, and either none, some, or all the
data was transferred. If there is buffered I/O, it is recommended that you call the
fush( ) function before the fseek() function to guarantee that the buffer charac-
ters were written.
[EINVAL] The whence parameter is an invalid value, or the resulting le offset would be
invalid.
274 Hewlett-Packard Company 527192-005