Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
5 Interoperating Between Programming Environments
This chapter is intended for users of the OSS and Guardian environments who need to understand
interoperability between the two environments. This chapter discusses:
• “Interoperability” (page 71) as it relates to programming environments
• “Header Files” (page 72) for compilation in the Guardian and OSS environments
• “API Interoperability” (page 73)
• “Process Interoperability” (page 74)
• “File Interoperability” (page 77)
• “Native Signal Interoperability” (page 80)
• “I/O Interoperability” (page 81)
• “Mixed-Module Programming” (page 82)
• “Mixed-Language Programming” (page 84)
Interoperability
One of the primary objectives of interoperability is to support and encourage the porting of existing
UNIX applications from other platforms to the OSS environment and the development of new
applications for the OSS environment. Another objective is the migration of Guardian applications
to the OSS environment. The OSS environment has been designed to make it easy to migrate
Guardian applications to the OSS environment. Interoperability between the OSS and Guardian
environments makes migration tasks easier to achieve. Applications written for the OSS environment
can take advantage of the parallelism and scalability offered by NonStop systems.
Interoperability between environments is achieved by using standard function calls and HP extensions
to these calls and to Guardian procedures. Interoperability is also achieved by adhering to the
ISO/ANSI C programming standards for code written in either environment. The C compilers, the
TNS C++ preprocessor, and the TNS/R and TNS/E native C++ compilers, conform to industry
standards and specifications such as ISO/ANSI C, POSIX.1, POSIX.2, and XPG4.
Many levels of interoperability have been provided between the OSS and Guardian environments;
for example, these actions are supported:
• Using a command from the other environment
• Using an API from the other environment
• Operating on an object (file, process) that resides in the other environment
• Communicating with a process in the other environment
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.
Major Differences Between Programming Environments
When using Guardian procedures in the OSS environment, you need to realize that the
characteristics of the Guardian environment are different from those of the OSS environment:
• Guardian processes are identified by their process handles; OSS processes are identified by
their process IDs and process handles. Guardian processes do not have OSS process IDs.
• Guardian startup messages are used to pass information from a ancestor process to the created
process when a Guardian process is created. In the OSS environment, the propagation of
shared memory and open files conforms to the UNIX model: an OSS process inherits the open
Interoperability 71