Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
10 Native Migration Overview
This chapter is intended for OSS and Guardian C or C++ programmers who are interested in
migrating their programs from the TNS environment to the TNS/R or TNS/E native environment.
It contains an overview of the major areas in which differences exist between the two systems’
development tools, and between the TNS and native execution environments. Refer to the C/C++
Programmer’s Guide, the Open System Services Programmer’s Guide, and the Guardian
Programmer’s Guide for detailed information about writing programs for the native environments.
Open System Services (OSS) supports native-mode applications written in C, C++, and pTAL for
the native environments. Programs written for D3x RVUs can still run the native environments in
TNS interpreted or accelerated mode, but benefits can be achieved by migrating these programs
to native mode. It is faster to compile programs in native mode than to compile and accelerate
programs in TNS accelerated mode.
The TNS/R and TNS/E native C compilers accept programs written in Common C as well as those
written in ISO/ANSI C. More OSS and Guardian API interoperability is provided in the OSS and
Guardian APIs that use the native environments.
You need to be concerned about the TNS and native C compiler development and debugging
tools, the differences in the C language syntax supported by the TNS, TNS/R, and TNS/E compilers,
the differences in the C run-time library routines, and differences in the Guardian API that supports
the native environments. More detailed information to help you migrate your applications to run
in native mode is available in the TNS/R Native Application Migration Guide and the H-Series
Application Migration Guide.
The topics included in This chapter are:
• “General Migration Issues” (page 170)
• “Native Environment Features” (page 171)
• “C/C++ Development Tools” (page 172)
• “User Library Migration Issues” (page 173)
• “C Language Compilers” (page 174)
• “Using the C Run-Time Library” (page 175)
• “Guardian Procedure Features” (page 176)
• “TAL to pTAL Conversion” (page 177)
General Migration Issues
TNS/R and TNS/E native environments support three execution environment modes: TNS interpreted,
TNS accelerated, and native mode. Major differences among these modes include support for the
Kernel-Managed Swap Facility (KMSF), shared run-time libraries (SRLs), dynamic-link libraries
(DLLs), and signals replacing traps in the Guardian environment.
HP supports development tools for native mode programs. These tools differ from those used to
develop TNS programs, and are available in the OSS environment as well as some workstation
environments. User libraries, SRLs, and DLLs are supported in TNS/R native mode. TNS/E native
mode supports DLLs and user libraries (actually a DLL), but not SRLs. To work with the c89 utility,
several tools are provided for building and analyzing native programs: The TNS/R environment
provides two native linkers (ld for position-independent code [PIC] files, nld for non-PIC files) and
a native object file tool (noft); the TNS/E environment provides a native linker (eld) and a native
object file tool (enoft) (these tools are also used with the c99 utility).
Some restrictions exist for the native mode environments. There is limited support for mixed-language
programming: only C, C++, and pTAL are supported. You cannot mix TNS interpreted, TNS
accelerated, or native object files in one program file. Embedded SQL, which is supported in TAL
170 Native Migration Overview