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-17
API Interoperability
Programmers Guide for more details on mixed-language programming. Refer to the
TAL Programmer’s Guide for details on writing CRE-compliant TAL code.
API Interoperability
API interoperability tables, listing all of the functions and macros in the Guardian C run-
time library and in the OSS C run-time library, give the programmer an overview of
which functions can be called from which module and from which process. See the
Open System Services Programmer’s Guide for complete details.
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 programming 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 on page 8-18
Using FIFOs on page 8-18
Using Files on page 8-19
Using Queue Files on page 8-19