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

Table Of Contents
Interoperating Between Programming Environments
Open System Services Porting Guide520573-006
5-7
Process-Management Interoperability
using HP extension functions such as tdm_fork() and tdm_spawn(), discussed in
the next subsection.
tdm_fork(), tdm_execve set, and tdm_spawn() Functions
A number of process-creation functions specific to HP are available in the OSS
environment to pass Guardian attributes from the parent process to the child process:
tdm_fork(), tdm_execve(), tdm_execvep(), and tdm_spawn(). For more
information about these functions, refer to the corresponding reference pages either
online or in the Open System Services System Calls Reference Manual.
These functions allow control of Guardian attributes in the child process. Typically,
these HP functions are used to run the child process in a processor other than the one
on which the parent process is running. In addition, these functions pass certain
POSIX inheritance attributes to the child process, give an OSS process a process
name, or run the process under the control of a choice of symbolic debuggers.
PROCESS_LAUNCH_ Procedure
All of the procedures and functions in Table 5-2 on page 5-6 can be called from the
OSS environment. However, fork(), the exec set of functions, tdm_fork(),
tdm_execve(), tdm_execvep(), and tdm_spawn() can be called only from the
OSS environment. From Table 5-2, only PROCESS_LAUNCH_ can be used to create
a Guardian process; the others create OSS processes.
The Guardian PROCESS_LAUNCH_ and PROCESS_SPAWN_ procedures obey the
Guardian MOM and ancestor relationships, but the OSS functions obey the UNIX
parent and child process relationships. See Using Process-Creation Calls on
page 6-13, for a discussion of the UNIX parent and child process relationship.
Guardian MOM and ancestors are notified of child termination using system messages
on $RECEIVE. OSS parents are notified of child termination using the SIGCHLD signal
and wait status.
PROCESS_SPAWN_ Procedure
This process-creation procedure is mainly used by Guardian programs that need to
create OSS processes. The osh utility uses PROCESS_SPAWN_ to start a Korn shell.
OSS scripts can also be run by executing this procedure.
The PROCESS_SPAWN_ procedure can be called either from the Guardian or OSS
environments. Various open timeout and nowait creation options are available with this
procedure. Note that the files are opened in the child process and are not propagated
or shared.
Process-Management Interoperability
In general, you should manage OSS processes with OSS functions, which makes your
applications more portable. However, there might be cases in which you want to use
Guardian procedures to manage OSS processes, or to use OSS functions to manage