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

System Functions (n - p) PUT_LOCKREC(2)
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit applications.
To use this function in a 32-bit application on systems running H06.24 or later RVUs or J06.13 or
later RVUs, perform the same tasks (described above) used to enable the function on systems
running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit application on systems running H06.24 or later RVUs or J06.13 or
later RVUs, you must perform all of the following tasks:
Include the pthread.h header file in the application.
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Compile the application using the -Wlp64 compiler command option.
Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
Considerations
Record locking versus file locking
A call to PUT_LOCKFILE() is not equivalent to locking all records in a file;
that is, locking all records still allows insertion of new records, but file locking
does not. File locks and record locks are queued in the order in which they are
issued.
Nowait and PUT_LOCKREC()
If the PUT_LOCKREC() function is used to initiate an operation with a file
opened for nowait I/O, it must complete with a corresponding call to the Guar-
dian AWAITIO procedure.
Default locking mode
If the record is already locked by another user when PUT_LOCKREC() is
called, the process requesting the lock is suspended and queued in a locking
queue behind other users also requesting to lock or read the record.
When the record becomes unlocked, the user at the head of the locking queue is
granted access to the record. If the user at the head of the locking queue is
requesting a lock, it is granted the lock and resumes execution. If the user at the
head of the locking queue is requesting a read operation, the read operation con-
tinues to completion.
Alternate locking mode
If the record is already locked by another user when PUT_LOCKREC() is
called, the lock request is rejected, and the call to PUT_LOCKREC() com-
pletes immediately with Guardian file-system error 73 (record is locked).
The alternate locking mode is specified by calling the PUT_SETMODE() pro-
cedure and specifying function 4.
527186-023 Hewlett-Packard Company 5229