Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
Native Migration Overview
Open System Services Porting Guide—520573-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.