Guardian Procedure Calls Reference Manual

Parameters
filenum
input
INT:value
is the number of an open file that identifies the file to be locked.
tag
input
INT(64):value
for nowait I/O only, is a value you define that uniquely identifies the operation associated
with this FILE_LOCKFILE64_ procedure call.
NOTE: The system stores the tag value until the I/O operation completes. It then returns the
tag information to the program in either the tag parameter of the call to FILE_AWAITIO64_
or the tag field of the completion-info parameter of the call to FILE_COMPLETEL_, thus
indicating that the operation finished.
Returned Value
INT
A file-system error code that indicates the outcome of the call.
Considerations
EpTAL callers must set toggle
EpTAL callers must set the toggle _64BIT_CALLS before sourcing the FILE_LOCKFILE64_
procedure section from EXTDECS.
Familiar semantics
Unless otherwise described, the semantic behavior of FILE_LOCKFILE64_ is the same as that
of LOCKFILE.
Nowait and FILE_LOCKFILE64_
If FILE_LOCKFILE64_ is called on a file opened for nowait I/O, then the operation must be
completed by calling either FILE_AWAITIO64_ or FILE_COMPLETEL_.
Locking modes
Default mode
If the file is already locked by another user when FILE_LOCKFILE64_ is called, the process
requesting the lock is suspended and queued in a "locking" queue behind other users
trying to access the file. When the file becomes unlocked, the user at the head of the
locking queue is granted access to the file. 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, the read operation continues to completion.
Alternate mode
If the file is already locked by another user when the call to FILE_LOCKFILE64_ is made,
the lock request is rejected, and the call to FILE_LOCKFILE64_ completes immediately
with error 73 (file is locked). The alternate locking mode is specified by calling the
FILE_SETMODENOWAIT64_ procedure and specifying function 4.
FILE_LOCKFILE64_ Procedure 451