Guardian Procedure Calls Reference Manual

CEXTDECS (through the included file TNSINTH) defines 32-bit values as the typedef
__int32_t, which for TNS and TNS/R compiles is defined as long and for TNS/E compiles
is defined as int.
The function value returned by LOCKREC, which indicates the condition code, can be
interpreted by _status_lt(), _status_eq(), or _status_gt() (defined in the file
tal.h).
Syntax for TAL Programmers
CALL LOCKREC ( filenum ! i
,[ tag ] ); ! i
Parameters
filenum
input
INT:value
is the number of an open file that identifies the file containing the record to be locked.
tag
input
INT(32):value
is for nowait I/O only. tag is a value you define that uniquely identifies the operation associated
with this LOCKREC.
NOTE: The system stores the tag value until the I/O operation completes. The system then
returns the tag information to the program in the tag parameter of the call to AWAITIO[X],
thus indicating that the operation completed.
Condition Code Settings
indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).< (CCL)
indicates that the LOCKREC was successful.= (CCE)
indicates that the file is not a disk file.> (CCG)
Considerations
Nowait and LOCKREC
If the LOCKREC procedure is used to initiate an operation with a file opened nowait, it must
complete with a corresponding call to the AWAITIO procedure.
Default locking mode
If the record is already locked by another user when 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 continues to completion.
Alternate locking mode
If the record is already locked by another user when LOCKREC is called, the lock request is
rejected, and the call to LOCKREC completes immediately with file-system error 73 (record is
776 Guardian Procedure Calls (L)