Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
An application program interface (API) is a set of functions or procedure declarations that permits
user programs to communicate with the operating system or subsystem. The OSS API coexists on
NonStop systems with the Guardian API.
Some functions and macros in the Guardian and OSS APIs can “interoperate” completely between
the Guardian and OSS environments: that is, they can be called from either a Guardian or OSS
module, can execute as part of a Guardian or OSS process, and can operate on Guardian or
OSS objects. Some functions and macros are more limited in their interoperability.
An OSS module is a module compiled to execute in the OSS environment. Likewise, a Guardian
module is a module compiled to execute in the Guardian environment. Normally, the environments
of a module and of the process containing the module are the same; however, an OSS process
can contain both OSS and Guardian modules, and a Guardian process can contain both Guardian
and OSS modules, as discussed later in “Mixed-Module Programming” (page 82).
Beginning with the H06.24 and J06.13 RVUs, features have been added for interoperability
between the 64-bit OSS programming environment and the Guardian programming environment.
For information about this type of interoperability, see the 64-Bit Support in OSS and Guardian
chapter in the Open System Services Programmer's Guide.
API Interoperability Tables
The API interoperability tables appear in the Open System Services Programmer’s Guide. These
tables describe the interoperability between the Guardian API and the OSS API. There is one API
interoperability table for TNS/R and TNS/E native processes and one for G-series TNS processes.
(The H-series and J-series OSS environments do not support TNS processes.)
For each function or macro listed in an API interoperability table, the level of interoperability it
provides is indicated by the following information:
• Whether the function or macro is part of the Guardian API, OSS API, or both.
• Where the function or macro is defined.
• Whether the function or macro can be called from a Guardian module, an OSS module, a
Guardian process, or an OSS process.
• Types of parameters (OSS or Guardian) the function or macro requires.
• Type of objects (OSS or Guardian) on which the function or macro operates.
Because a function can be called from both Guardian and OSS processes or Guardian and OSS
modules does not mean that the function behaves the same in each environment. Function behavior
can be identical, nearly identical, or different. Refer to the API interoperability tables for details of
these behavioral differences.
Environment-Specific Functions
The use of a common shared run-time library or dynamic-link library between OSS and Guardian
TNS/R and TNS/E native programs promotes greater interoperability between the two environments.
However, for input and output, those functions that handle Guardian filenames or OSS pathnames
remain environment-specific. The functions that require environment-specific parameters include
fopen(), fopen64(), freopen(), freopen64(), remove(), rename(), tmpfile(),
tmpfile64(), and tmpnam(). Guardian-specific and OSS-specific versions of these functions
are provided for use from the opposite environment.
Process Interoperability
You create, control, and terminate OSS processes in the OSS environment as you would in a
standard UNIX environment. In addition to the standard set of UNIX process-management functions
in the OSS environment, there are several HP extension functions that provide flexibility in
propagating attributes during process creation.
74 Interoperating Between Programming Environments