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-30
Use of Common Run-Time Environment (CRE)
Functions
functions specified by the XPG4 specifications. It also provides HP extensions for input
and output, memory management, string manipulation, and fault-tolerant programming.
All ISO/ANSI C functions are available in both environments. Some of the XPG4
functions and HP extension functions are available only in one environment. Refer to
the API interoperability tables in the Open System Services Programmers Guide to
determine which functions are available from the OSS environment. If a Guardian
program uses a Guardian C run-time routine that is available only in the Guardian
environment, the routine needs to be replaced by an OSS routine with equivalent
behavior. The complete semantics and syntax of the Guardian C run-time routines are
described in the Guardian Native C Library Calls Reference Manual. For OSS C run-
time routines, refer to the Open System Services Library Calls Reference Manual.
When a program is migrated from the Guardian environment to the OSS environment,
many of the C run-time routines used in the program can be used as is. The
exceptions are those that are specific to the Guardian environment and those which
have the same name in both environments but use different arguments in the two
environments. All calls to run-time routines that use a Guardian filename argument
need to be modified to use the OSS version of the run-time routines which use an OSS
pathname argument.
In cases where the Guardian routines have no equivalents in the OSS environment,
you have two options. The first is to compile the module containing the Guardian C
run-time routine as a Guardian module; the second is to replace the module with an
equivalent module. The second option will make the program more portable to other
open systems environments. You should refer to the C/C++ Programmers Guide for
more details on which C run-time routines work in which environment. The API
interoperability tables in the Open System Services Programmers Guide also provide
an overview of how and where each C run-time routine can be used.
In addition to the OSS C run-time routines, the XPG4 system calls, and most Guardian
procedure calls that can be used in an OSS program, some HP process-creation
functions can also be used in a program that is being migrated from the Guardian
environment to the OSS environment. These include tdm_fork() and the
tdm_execve set of functions that can be used to create OSS processes with specific
Guardian attributes such as process name, processor number, process priority, and
home terminal. The tdm_spawn set of functions can be used to run an OSS program
with specific Guardian attributes in one automatic operation. These HP functions
provide more interoperability between the Guardian and OSS environments.
Use of Common Run-Time Environment (CRE) Functions
The Common Run-Time Environment (CRE) library functions provide a common set of
services to programs in both the OSS and Guardian environments. They can be used
with the following restrictions in the OSS environment:
File sharing functions cannot be used.
CRE mathematical functions do not trap if an invalid parameter is passed, but they
do set the errno variable.