MPE/iX Intrinsics Reference Manual (32650-90905)

234 Chapter6
Command Definitions (FLUSHLOG-GETUSERMODE)
FOPEN
Dynamic locking/unlocking is made possible through the equivalent of a
global resource identification number (RIN) assigned to the file and
temporarily acquired by FOPEN.
Cooperating accessors that have opened a file with the dynamic locking
option enabled must access the file using either 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
exclusiveness is not guaranteed.
Lock access is available to a process if it has lock, execute, append, or write
access to the file. This option is ignored for files not residing on disk.
If this option is specified for a new file, the dynamic locking bit is NOT
changed to 0 as it is on MPE V systems. When a file is new, there can be
only one accessor so setting this bit really makes no sense. When opening a
directory, dynamic locking must be set to 0 (disallowed).
(ASC) Not valid for asynchronous device files.
8:2 Exclusive option
Indicates continuous exclusive access to this file, from open to close. Use
this option when performing a critical operation (for example, updating
the file).
The following bit settings are valid:
00 If access type option (
aoption
bits (12:4)) specifies read
only access, then read-share access takes effect.
Otherwise, exclusive access takes effect. Regardless of
which access option was selected, FFILEINFO reports zero.
01 Exclusive access. After the file is opened, any additional
HPFOPEN/FOPEN requests for this file are prohibited until
this process issues the FCLOSE request or terminates. If
any process is already accessing this file when an
HPFOPEN/FOPEN call is issued with exclusive access
specified, an error status is returned. If another
HPFOPEN/FOPEN call is issued for this file while exclusive
access is in effect, an error code is returned to the process
that issued the call. Request exclusive access only if the
lock access mode is allowed by the security provisions for
the file.
For message files, specifying this value indicates that
there can be only one writer and only one reader.
Exclusive access cannot be specified for directories.
10 Read-share access (semi-exclusive access). After the file is
opened, concurrent write access to this file through
another HPFOPEN/FOPEN request is prohibited, whether
issued by this process or another process, until this
process issues the FCLOSE request or terminates. A