Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

Side Effects
When a Guardian process starts to use OSS services, it may observe several side effects, depending
on the procedure used:
Two file numbers are allocated, but not necessarily the next available two numbers, for use
as the root and current working directories. Once allocated, these files cannot be closed by
calling FILE_CLOSE_.
A current working directory is assigned based on the current value of the VOLUME attribute
of the =_DEFAULTS DEFINE.
A small increase in the static (resident) memory used by the process will be observed.
These effects happen only upon the first usage and exist until the process terminates.
When a Guardian process makes its first OSS call that requires an OSS name server lookup (that
is, any call with an OSS pathname), the process’ current working directory appears as the /G
version of the default subvolume (as contained in the VOLUME attribute of the =_DEFAULTS DEFINE).
Changes to the =_DEFAULTS DEFINE after this point do not affect the current working directory,
and changes to the process’ current working directory do not affect the =_DEFAULTS DEFINE—the
two remain independent.
Interoperating With OSS Programs
Two different process types are supported by the NonStop operating system: the Guardian process
model and OSS process model. The model used by each type of process is different, and the
information kept in the NonStop operating system about each type of process is different. One
way to migrate a Guardian program to openness is to use Guardian procedure calls that are able
to manipulate OSS objects (files and processes) or to use OSS functions directly. Another way is
to use the interprocess communication (IPC) procedures that allow Guardian and OSS processes
to communicate with each other, as described in the following subsections:
“$RECEIVE” (page 149)
“Using FIFOs” (page 150)
“Using Files” (page 150)
“Using Queue Files” (page 150)
“Using Shared Memory” (page 150)
“Using Semaphores” (page 151)
“Using Intermediate Processes” (page 151)
“Using Signals” (page 151)
The proper use of the appropriate IPC mechanisms enables a Guardian process to communicate
with an OSS process, giving it greater access to the open environment. See also “Using Interprocess
Communication (IPC) Mechanisms” (page 88).
Processes running on different nodes in a network can communicate only by using the Guardian
$RECEIVE file or Guardian sockets. Using Guardian sockets is encouraged because sockets are
the most widely used interface for interprocess communication between heterogeneous computer
systems. However, when a Guardian or OSS process must communicate with a process on another
node already using its $RECEIVE file to get system messages and messages from other processes,
the Guardian process should communicate with that process using its $RECEIVE file.
$RECEIVE
Guardian and OSS processes can communicate with each other using $RECEIVE to receive
messages from other processes or system messages. The process acting as the server must be a
named process and use the FILE_OPEN_ procedure to open the $RECEIVE communication channel.
Interoperating With OSS Programs 149