Open System Services System Calls Reference Manual (G06.28+)

SPT_FILE_OPEN_(2) OSS System Calls Reference Manual
primary_processhandle
Indicates that the caller is requesting a backup open and species the process
handle of the primary process that already has the le open when its backup
attempts to open the le. If this parameter is supplied and not null (a null pro-
cess handle has -1 in each word), lenum must contain the lenum value that was
returned to the primary. If a null process handle is supplied, or the parameter is
omitted, a normal open is being requested. This option is used only when the
backup process is the caller. It is more common for the primary process to per-
form this operation by a call to the FILE_OPEN_CHKPT_ procedure.
elections Species the following options as a bit mask:
0 through 30 Reserved; specify 0 (zero).
31 Use 64-bit primary keys. For disk les only, bit 31 species that
64-bit primary-key values are used instead of 32-bit values for
unstructured, relative, or entry-sequenced les. Bit 31 is ignored
for key-sequenced les and nondisk devices.
The elections parameter can be used with both Format 1 and Format 2 Guardian
les. If this parameter is omitted, 0 (zero) is used for all bits.
DESCRIPTION
The SPT_FILE_OPEN_() function is the thread-aware version of the Guardian FILE_OPEN_
procedure.
The SPT_FILE_OPEN_() function establishes a communication path between an application
process and a le. When SPT_FILE_OPEN_( ) successfully completes, it returns a Guardian le
number to the caller. The le number identies this access path to the le in subsequent Guar-
dian le-system calls.
General Considerations
File numbers File numbers are unique within a process. The lowest le number is 0 (zero) and
is reserved for $RECEIVE; the remaining le numbers start at 1. The lowest
available le number is always assigned, except in the case of backup opens.
When a le is closed, its le number becomes available for a subsequent le
open to use.
Maximum number of open files
The maximum number of les in the system that can be open at any given time
depends on the space available for control blocks: access control blocks
(ACBs), le 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. The maximum amount of space for ACBs is deter-
mined by the size of the process le segment (PFS). See the description of the
pfs-size parameter for the PROCESS_CREATE_ procedure in the Guardian Pro-
cedure Calls Reference Manual.
Multiple opens by the same process
If a given le is opened more than once by the same process, a unique le
number is returned for each open. These le numbers provide logically separate
accesses to the same le; each le number has its own ACB, its own le posi-
tion, and its own last error value. If a nowait I/O operation haS begun and a
second nowait operation is started (using a second le number for the same le),
the I/O requests:
7140 Hewlett-Packard Company 527186-005