Using KSAM/XL and KSAM 64 (32650-90886)

Chapter 9 159
KSAM Intrinsics
HPFOPEN
12 I32 Dynamic locking:
Passes a value enabling or disabling file locking for the file. When
specified, the FLOCK and FUNLOCK intrinsics can be used to dynamically
permit or restrict concurrent access to a disk file by other processes at
specified times.
The following values are valid:
0 Disallow dynamic locking/unlocking
1 Allow dynamic locking/unlocking
Default: 0
The process can continue this temporary locking or unlocking until it
closes the file. If several accessors are sharing the file, they must all
specify, or not specify, this option. For example, if a file is opened with the
dynamic locking option enabled, and a subsequent accessor tries to open
the file with dynamic locking disabled, that subsequent attempt to open
fails.
Dynamic locking and unlocking are possible through the equivalent of a
global resource identification number (RIN) assigned to the file and
temporarily acquired by HPFOPEN.
Accessors that have opened a file with the dynamic locking option
enabled must access the file through the FLOCK and FUNLOCK intrinsics to
ensure exclusive use of the file. These accessors are allowed concurrent
access even when not using FLOCK and FUNLOCK, but exclusive access is
not guaranteed.
Note: The file system does not guarantee exclusive access, even when
FLOCK and FUNLOCK are used, unless all programs that access the file
cooperate by using locking. A program that opens the file with dynamic
locking enabled will still be allowd to modify the file, even if it never calls
FLOCK.
Lock access must be at the account, group, and file levels for HPFOPEN to
grant this option. (Lock access is available if lock, execute, append, or
write access is set at these levels.) This option is ignored for files not
residing on disk.
Table 9-7. HPFOPEN Itemnum/Item Values
Itemnum Mnemonic Item Description