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

Table Of Contents
Interoperating Between Programming Environments
Open System Services Porting Guide520573-006
5-9
Process-Termination Interoperability
Process-Termination Interoperability
When a process calls PROCESS_SPAWN_ to create a process, the parent process is
treated as a Guardian process, regardless of whether the caller is an OSS or Guardian
process. In this case, the parent process receives process-termination notification
through Guardian system messages (instead of the SIGCHLD signal, which is normal
notification for OSS processes). The parent process reads system messages from
$RECEIVE, which is a special file through which a process receives system messages
or messages from other processes.
The exit() and _exit() function calls can be issued by either an OSS process or a
Guardian process. If the parent process is an OSS process, the normal SIGCHLD
signal is sent to notify the parent process of the death of one of its child processes.
Child processes of a terminated process are assigned a parent process ID of 1. For
more information about the exit function, refer to the exit(3) reference page either
online or in the Open System Services Library Calls Reference Manual. For more
information about the _exit function, refer to the _exit(2) reference page either
online or in the Open System Services System Calls Reference Manual.
File Interoperability
You access OSS files in the OSS environment as you would access UNIX files. The
OSS environment also allows you to access a limited set of files in the Guardian
environment, which means that you can create applications for NonStop systems that
use data in Guardian files and that take advantage of OSS portability and other OSS
features.
Use OSS file system functions to manipulate OSS files if you want your program to be
portable to other UNIX environments. However, it may be necessary to manipulate
Guardian files using the OSS API, or to manipulate OSS files using the Guardian API.
The FILENAME_TO_PATHNAME_ and PATHNAME_TO_FILENAME_ Guardian
mapping procedures provide the link between OSS pathnames and Guardian
filenames. These two procedures are discussed more in Guardian Procedure Calls for
Interoperability on page 7-26.
Accessing Files From the OSS API
OSS functions are tailored to the OSS environment and work more efficiently than
Guardian procedures on OSS files. You can access three types of Guardian files with
OSS functions:
Odd-unstructured files (file types 0, 100, and 180). These files permit reading and
writing of both even and odd byte counts and positioning to both even and odd
byte addresses. Unstructured files do not have a built-in record structure.
EDIT files (file type 101). These files are unstructured. You can access them only
for reading.
Telnet processes.