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

spt_fcntlz(2) OSS System Calls Reference Manual
For C++ applications, an alias to map fcntl( ) to spt_fcntlz() 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 value returned by the spt_fcntlz( ) function depends on the
value of the request parameter, listed:
F_DUPFD Returns a new file descriptor.
F_GETFD Returns the value of the file descriptor flags. The return value is not negative.
F_GETFL Returns the value of file status flags and access modes. The return value is not
negative.
F_GETLK Returns the value 0 (zero).
F_GETLK64 Returns the value 0 (zero).
F_GETOWN Returns the process ID or process group ID of the socket receiving a SIGURG
signal. A positive value is a process ID; a negative value is a process group ID.
F_SETFD Returns the value 0 (zero).
F_SETFL Returns the value 0 (zero).
F_SETLK Returns the value 0 (zero).
F_SETLK64 Returns the value 0 (zero).
F_SETLKW Returns the value 0 (zero).
F_SETLKW64
Returns the value 0 (zero).
F_SETOWN Returns the value 0 (zero).
If the spt_fcntlz() function fails, the value -1 is returned, and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the spt_fcntlz( ) function sets errno to the corresponding
value:
[EAGAIN] The request parameter is F_SETLK or F_SETLK64, the type of lock (l_type)is
shared (F_RDLCK) or exclusive (F_WRLCK), and a segment of a file to be
locked is already exclusive-locked by another process.
The request parameter is is F_SETLK or F_SETLK64, the type of lock is
exclusive, and some portion of a segment of a file to be locked is already
7170 Hewlett-Packard Company 527186-023