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
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide—520573-006
8-25
Compiler Tools
Compiler Tools
In the Guardian environment, TNS C or C++ source modules are compiled using the
TACL C command with appropriate qualifiers and parameters. When the executable
program is built from more than one source module, each source module must be
compiled separately and bound using the BIND command in a separate step. The
BIND input file specifies all of the input object files and the libraries to be searched to
build the final executable file. If the executable is to be accelerated, this is done with a
separate command after the bind phase.
For the native environments, C compilation in the Guardian environment is performed
by the native C compilers (NMC for TNS/R native C, CCOMP for TNS/E native C) and
native C++ compilers (NMCPLUS for TNS/R native C++, CPPCOMP for TNS/E native
C++). In the OSS environment, the C compilation, linking, and optimization steps are
each performed indirectly using the appropriate parameters with the c89 utility, the
driver program for the native C compilers.
In the OSS environment, all of the compilation, linking, and optimization steps required
to build the final executables are specified in a make file. The make file, used by the
make utility, contains a list of dependencies for each target to be built. When migrating
Guardian programs written in C or C++ to the OSS environment, you are encouraged
to use the set of tools available in the OSS environment to build, test, and debug your
application.
The same Inspect, Native Inspect, and Visual Inspect debuggers available in the
Guardian environment are available in the OSS environment. Additional tools such as
ar(1), nm(1), strip(1), and strings(1) are also available in the OSS
environment. Read the appropriate reference pages for these tools online or in the
Open System Services Shell and Utilities Reference Manual.
Memory Models
In the OSS environment, only the wide memory model is supported. Thus, all modules,
Guardian and OSS, must be compiled with the wide memory model enabled. If the
original Guardian C or C++ source code used the small or large model, all 16-bit int
data elements become 32-bit int data elements. Thus, if your application requires 16
bits for a data element, use short rather than int. If your application requires 32 bits
for a data element, use long rather than int. If it does not matter whether the data
element is 16 bits or 32 bits, you can continue to use int. The use of the proper data
type is particularly important when calling a Guardian procedure which requires
parameters that are of a particular size.
Header Files
The header files used by the c89 utility in the OSS environment are located in the
/usr/include directory, as in other UNIX systems. The contents of the header files
are identical to the contents of the corresponding header files maintained in the
Guardian file system in $SYSTEM.SYSTEM. The contents of