Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Native Migration Overview
Open System Services Porting Guide520573-006
10-7
Using the C Run-Time Library
The native C and C++ compilers require that certain pragmas be specified as flags
to the OSS c89 utility if the default settings are not desired; for instance, the
INSPECT, RUNNABLE, SEARCH, SSV, and other pragmas. For details on C or C++
program compilation in the OSS environment, refer to the c89(1) reference page
either online or in the Open System Services Shell and Utilities Reference Manual.
3. Check the use of changed pragmas. Certain pragmas produce different results with
the native C compilers than with the TNS C compiler. These include the
[NO]INLINE, OPTIMIZE, SEARCH, SQL, and [NO]WARN pragmas.
4. Remove obsolete pragmas. Certain pragmas must be removed from your C and
C++ source files to use the native C and C++ compilers. These include
ANSICOMPLY, [NO]CHECK, OLDCALLS, and others.
5. Delete the use of obsolete keywords such as _cspace and _lowmem.
6. There are changes in data alignment with the use of values for the FIELDALIGN
pragma, such as auto, cshared2, and shared2 in the native C compilers, from
their use in the TNS C compilers. Native C or C++ programs that share data
structures with TNS C or C++ programs might require the use of the CSHARED2
pragma. Native programs that share data structures with TAL programs or
Guardian API structures might require the use of the SHARED2 pragma.
Using the C Run-Time Library
Some of the C run-time library routines in programs written for Open System Services
on D3x RVUs might have to be replaced or changed if the programs are to run in
native mode. The most significant changes are included in the following subsections.
Obsolete Library Functions
Replace obsolete C library supplementary functions iscsym(), memswap(),
stscmp(), and others. Certain functions that are supported in the TNS C run-time
library are not supported in the native C run-time library. In almost all cases, equivalent
replacement functions are available in the native C run-time library.
Remove obsolete C run-time library functions for trap handling, such as
trap_overflows() and _is_system_trap(). The trap handling mechanism is
replaced with signals in native processes. (This is relevant only in the Guardian
environment.)
Replace obsolete C library Guardian alternate-model I/O functions close(), open(),
read(), write(), and others. To improve interoperability between the Guardian and
OSS environments, the native environment does not support the Guardian alternate-
model I/O functions. These functions must be replaced by the equivalent OSS file-
descriptor-model functions or by the equivalent ISO/ANSI model I/O functions.