Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (O)
Guardian Procedure Calls Reference Manual—522629-013
11-19
OPEN Procedure (Superseded by FILE_OPEN_
Procedure )
Considerations
•
File numbers
Within a process, the file numbers are unique. The lowest numeric file number is 0
and is reserved for $RECEIVE. Remaining file numbers start at 1. The lowest
available file number is always assigned. Once a file is closed, its file number
becomes available, and a subsequent open can reuse that file number.
•
Maximum number of open files
The maximum number of files in the system that can be open at any given time
depends on the space available for control blocks; access control blocks (ACBs),
file control blocks (FCBs), and open control blocks (OCBs). The amount of space
available for control blocks is limited primarily by the physical memory size of the
system. Each process can have up to one megabyte of space for ACBs; the
default is 128 kilobytes for ACBs.
•
Multiple openings by the same process
If a given file is opened more than once by the same process, a new ACB is
created for each open. This provides logically separate accesses to the same file
because a unique file number returns to the process for each open. Whenever you
reference a file in a procedure, the file number is supplied by you in the
filenum
parameter of the procedure.
Multiple opens on a given file can create a deadlock. The following shows how a
deadlock situation occurs:
OPEN( MYFILE , filenuma ... );
! first open on file MYFILE.
.
.
OPEN( MYFILE , filenumb ... );
<9> %100 Must be 0 (reserved)
<10:11
>
%60
(If both bits set)
Exclusion mode
0 = shared
1 = exclusive
2 = process exclusive (supported for Optical Storage
Facility only)
3 = protected
<12:15
>
%17
(If all four bits
set)
> 0implies nowait I/O and the maximum number of
concurrent nowait I/O operations that can be in
progress on this file at any given time.
0 implies waited I/O.
Table 11-2. OPEN flags Parameter (page2of2)
Flag Flag in Octal Meaning