Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) SPT_FILE_OPEN_(2)
primary_processhandle
Indicates that the caller is requesting a backup open and specifies the process
handle of the primary process that already has the file open when its backup
attempts to open the file. If this parameter is supplied and not null (a null pro-
cess handle has -1 in each word), filenum must contain the filenum 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. Use this option 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 Specifies the following options as a bit mask:
0 through 30 Reserved; specify 0 (zero).
31 Use 64-bit primary keys. For disk files only, bit 31 specifies that
64-bit primary-key values are used instead of 32-bit values for
unstructured, relative, or entry-sequenced files. Bit 31 is ignored
for key-sequenced files and nondisk devices.
You can use the elections parameter with both Format 1 and Format 2 Guardian
files. 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 file. When SPT_FILE_OPEN_() successfully completes, it returns a Guardian
file number to the caller. The file number identifies this access path to the file in subsequent
Guardian file-system calls.
General Considerations
File numbers File numbers are unique within a process. The lowest file number is 0 (zero) and
is reserved for $RECEIVE; the remaining file numbers start at 1. The lowest
available file number is always assigned, except in the case of backup opens.
When a file is closed, its file number becomes available for a subsequent file
open to use.
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. The maximum amount of space for ACBs is deter-
mined by the size of the process file 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 file is opened more than once by the same process, a unique file
number is returned for each open. These file numbers provide logically separate
accesses to the same file; each file number has its own ACB, its own file 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 file number for the same file),
the I/O requests:
527186-023 Hewlett-Packard Company 7−195