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-31
Replacing Guardian Procedure Calls With
Equivalent OSS Functions
$RECEIVE processing functions cannot be used to access process startup
sequence information, including ASSIGNs and PARAMs. ($RECEIVE processing
functions can continue to be used for interprocess communication.)
These restrictions must be taken into consideration when migrating a Guardian
program to the OSS environment.
Replacing Guardian Procedure Calls With Equivalent OSS
Functions
To make the program as open as possible and, therefore, portable to other UNIX
environments, you may want to replace some of the Guardian procedure calls with
equivalent OSS C library run-time calls or OSS system calls. There is no one-to-one
replacement mechanism that can be recommended for the Guardian procedure calls.
The OSS file system routines are limited to dealing with odd-unstructured files, EDIT
files, and terminals. Thus, programs which need to deal with other kinds of files will
need to continue to use the Guardian procedures.
The OSS process-management routines deal with process IDs rather than with
process handles. Thus, programs which use Guardian process-management routines
will need modifications to use the equivalent OSS process-management routines.
Because process termination is done with system messages in the Guardian
environment, and with exit() status and SIGCHLD signal in the OSS environment,
the logic of the Guardian program will need to be modified accordingly to work in the
OSS environment. Because most Guardian system procedure calls will continue to
work in the OSS environment as they did in the Guardian environment, a complete
replacement of Guardian system procedure calls with equivalent OSS system calls and
run-time routines is not necessary.
Which IPC Mechanisms Can Be Used
The IPC mechanisms available to a Guardian program for communicating with other
Guardian programs and with OSS programs are generally available to an OSS
program as well. The use of $RECEIVE still requires using Guardian procedure calls,
but Guardian sockets can be used in OSS programs in the same way they are used in
Guardian programs. Pipes can be used between two related OSS processes, whereas
they cannot be used in the Guardian environment. Files and queue files can be used in
the OSS environment in the same manner as they are used in the Guardian
environment. The use of OSS shared memory and OSS semaphores is encouraged
when communicating between two OSS processes, but flat segments can be shared
between OSS and Guardian processes using Guardian procedure calls as well.
Interactions Between Guardian and OSS Functions
There is a common problem associated with some forms of interprocess
communication (including death notification) between processes of differing Guardian
and OSS types. This is referred to as the exec problem.” You must be aware of this
issue when mixing OSS and Guardian IPC functions within an OSS program.