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-14
Using OSS Functions in a Guardian Program
management procedures with OSS processes are shown in the Open System Services
Programmers Guide.
Using OSS Functions in a Guardian Program
A Guardian program written in C normally uses Guardian procedure calls (documented
in the Guardian Procedure Calls Reference Manual) and run-time routines from the
Guardian C run-time library (documented in the Guardian TNS C Library Calls
Reference Manual or the Guardian Native C Library Calls Reference Manual). To add
open features to a Guardian program, the program can make use of OSS function calls
(documented in the Open System Services System Calls Reference Manual and Open
System Services Library Calls Reference Manual).
This subsection discusses the criteria that determine which OSS functions can be used
in a Guardian program and how to use these functions.
The various C functions that are linked into a program have operational characteristics
that depend on the target environment (OSS or Guardian) and the subset of the
language being used. The normal behavior for a function in a given environment is to
operate within a process of that environment and on objects within that environment.
Many functions (such as mathematics and memory functions) behave the same,
regardless of the environment. However, some functions can operate within processes
of the opposite environment, or on objects of the opposite environment, to some
extent.
Interoperability, as it relates to the use of functions, is defined as the use of a function
that normally operates in the opposite environment process, the use of a function on
an object which lives in the opposite environment, or mixing the use of both
personalities inside the same program.
The criteria that affect API usage are described in the following subsections:
Memory Model to Be Used on page 8-14
Process Target Type on page 8-15
Use of Environment-Specific Functions on page 8-15
Object Type Being Manipulated on page 8-16
Language or C Environment Type on page 8-16
API Interoperability on page 8-17
Side Effects on page 8-17
Memory Model to Be Used
The C language supports three models (small, large, wide), varying in the width of an
integer, in the width of a pointer, and in various combinations thereof. OSS functions
support only the wide model (int is 32 bits, pointer size is 32 bits). Thus, the use of
OSS routines is confined to Guardian programs that use the wide model, which is true
for both C and TAL programs.