Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

spt_lseekz(2) OSS System Calls Reference Manual
For C applications, a macro to map lseek() to spt_lseekz() is available when you use the #define
SPT_THREAD_AWARE_XNONBLOCK preprocessor directive before including spthread.h
or when you use an equivalent compiler command option to compile the application.
For C++ applications, an alias to map lseek() to spt_lseekz() is available when you use the
#define SPT_THREAD_AWARE_PRAGMA_XNONBLOCK preprocessor directive before
including spthread.h or when you use an equivalent compiler command option to compile the
application.
To use this function in a threaded application that uses the Standard POSIX Threads library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks:
Include the spthread.h header file in the application.
Compile the application using the _SPT_MODEL_ feature test macro or equivalent
compiler command option in addition to any other feature test macros in use.
Link the application to the zsptdll library (/G/system/zdllnnn/zsptdll).
RETURN VALUES
Upon successful completion, the resulting pointer location, measured in bytes from the beginning
of the file, is returned. For First-in, First-out (FIFO) files, pipes, and character special files, the
value 0 (zero) is returned. For character special files, errno is not set.
If the spt_lseekz() function fails, the file offset remains unchanged, the value -1 cast to the type
off_t is returned, and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the file offset remains unchanged, and the spt_lseekz() func-
tion sets errno to the corresponding value:
[EBADF] The filedes parameter is not an open file descriptor.
[EINVAL] One of these conditions exists:
The whence parameter is an invalid value, or the resulting file offset
would be an invalid value (that is, a value less than 0 [zero]).
The filedes parameter refers to a file (other than a pipe, FIFO, or direc-
tory) on which seeking cannot be performed.
[EISDIR] The filedes parameter refers to an OSS directory.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
[EOVERFLOW]
The application was compiled in a regular compilation environment or was com-
piled using the #define _LARGEFILE64_SOURCE 1 feature test macro (or an
equivalent compiler command option), and the application attempted to set the
pointer location at a position between 2 gigabytes minus 1 byte and the max-
imum file offset established when the file was opened.
7294 Hewlett-Packard Company 527186-023