Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
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 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, 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 file 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 file 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 file 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 stream’s buffer needed to be
flushed 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 flag is set for the file descriptor underlying the stream
parameter and the process would be 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 an offset of 2 gigabytes. The file offset maximum for this function, |
for both OSS files and Guardian files, is 2 gigabytes.
[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
fflush( ) 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 file offset would be
invalid.
2−96 Hewlett-Packard Company 527192-007