Guardian Procedure Calls Reference Manual
FILE_LOCKREC64_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Returned Value
Considerations
OSS Considerations
Related Programming Manual
Summary
The FILE_LOCKREC64_ procedure excludes other users from accessing a record at the current
position. The "user" is defined either as the opener of the file (identified by the filenum) if the
file is not audited—or the transaction (identified by the TRANSID) if the file is audited.
NOTE: FILE_LOCKREC64_ operations cannot be used with queue files.
For key-sequenced, relative, and entry-sequenced files, the current position is the record with a key
value that matches exactly the current key value. For unstructured files, the current position is the
relative byte address (RBA) identified by the current-record pointer.
FILE_LOCKREC64_ extends the capabilities of LOCKREC in the following ways:
• It is callable from both 32-bit and 64-bit processes.
• It allows a 64-bit nowait I/O tag to be passed.
• Rather than returning a condition code status, the procedure returns a file management error.
A return value of zero indicates success.
If the record is unlocked when FILE_LOCKREC64_ is called, the record becomes locked, and the
caller continues executing.
If the file is already locked by another user, behavior of the system is specified by the locking
mode. There are two "locking" modes available:
• Default—Process requesting lock is suspended (see Considerations).
• Alternate—Lock request is rejected with file-system error 73. When the alternate locking mode
is in effect, the process requesting the lock is not suspended (see Considerations).
NOTE: A call to FILE_LOCKREC64_ 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 they are issued.
The FILE_LOCKREC64_ procedure is supported on systems running H06.24 and later H-series
RVUs and J06.13 and later J-series RVUs. Its use is recommended for new code.
Syntax for C Programmers
#include <cextdecs(FILE_LOCKREC64_)>
short FILE_LOCKREC64_ ( short filenum
,[ long long tag ] );
FILE_LOCKREC64_ Procedure 453