MPE/iX Intrinsics Reference Manual (32650-90875)

Chapter 5 219
Command Definitions (FCONTROL - FLOCK)
FLOCK
FLOCK
NM and CM callable.
Dynamically locks a file. If dynamically locking more than one RIN, multiple RIN (MR)
capability is required.
Syntax
I16V U16V
FLOCK(
filenum,lockflag
);
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file whose global resource identification
number (RIN) is to be locked.
lockflag
16-bit unsigned integer by value (required)
Specify either conditional or unconditional locking by setting bit (15:1) as
follows:
Value Meaning
0 Locking takes place only if the flock_semaphore of the
global unique file descripter (gufd) is used to control access
to the file. If the RIN is locked, control returns
immediately to the calling process, with condition code
CCG (0).
1 Locking takes place unconditionally. If the file cannot be
locked immediately, the calling process suspends until the
file can be locked.
Condition Codes
The following condition codes are possible when
lockflag
bit (15:1)=1:
CCE (2) Request granted.
CCG (0) Not returned.
CCL (1) Request denied. This file was not opened with the dynamic locking
aoption
bit (10:1) specified in the FOPEN/HPFOPEN intrinsic, or there was
an attempt to lock more than one RIN and the calling process does not
have multiple RIN (MR) capability.