Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (L)
Guardian Procedure Calls Reference Manual522629-013
8-11
LOCKFILE Procedure
LOCKFILE Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Condition Code Settings
Considerations
OSS Considerations
Related Programming Manual
Summary
The LOCKFILE procedure is used to exclude other users from accessing a file (and
any records within that file). The “user” is defined either as the opener of the file
(identified by
filenum) if the file is not audited—or the transaction (identified by the
TRANSID) if the file is audited.
If the file is currently unlocked or is locked by the current user when LOCKFILE is
called, the file (and all its records) 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 the 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”).
Syntax for C Programmers
CEXTDECS (via 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 LOCKFILE, which indicates the condition code, can
be interpreted by
_status_lt(), _status_eq(), or _status_gt() (defined
in the file
tal.h).
#include <cextdecs(LOCKFILE)>
_cc_status LOCKFILE ( short filenum
,[ __int32_t tag ] );