Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide520573-006
8-18
$RECEIVE
Using Shared Memory on page 8-19
Using Semaphores on page 8-19
Using Intermediate Processes on page 8-20
Using Signals on page 8-20
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 the Using Interprocess Communication (IPC) Mechanisms on page 6-3.
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. The process acting as the requester must use the
FILE_OPEN_ procedure to open a communication channel to the named server
process. A named OSS process can be created by:
Using tdm_fork(), tdm_execve(), or tdm_spawn() from another
OSS process
Using the PROCESS_SPAWN_ procedure from a Guardian process
Using the run command within the OSS shell
Using the osh command with the -name option from the Guardian environment
When $RECEIVE is used, system messages can arrive on it; the program must be
prepared to deal with them. The server or requester can be an OSS process. It is
common for the requester/server relationship to be that the requester opens the server
and writereads to the server. The server manages the opens issued by the requester.
Sample programs using $RECEIVE are included in the Open System Services
Programmers Guide.
Using FIFOs
Guardian and OSS processes can communicate through FIFOs because a FIFO has a
name that both processes can see and open. The Guardian process must open the
FIFO using the OSS C fopen() function because the FIFO exists in the OSS file
namespace.