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
The Development Environment
Open System Services Porting Guide—520573-006
2-3
File Compatibility
File Compatibility
The native processing environments can execute native executable files; TNS/R native
object files execute in the TNS/R native environment, and TNS/E native object files
execute in the TNS/E native environment. The G-series TNS/R native processing
environment can also execute TNS interpreted files and TNS accelerated files in both
the Guardian and OSS environments. In the H-series TNS/E native processing
environment, only the Guardian environment can execute TNS interpreted and
accelerated files; the H-series OSS environment does not support TNS interpreted and
accelerated execution modes.
To reap any performance benefits from executing a TNS executable file on a RISC or
Itanium processor, the file needs to be accelerated. Two accelerator programs are
provided, one to accelerate programs for execution on a TNS/R system and one to
accelerate programs for execution on a TNS/E system. (A TNS/E-accelerated program
can execute only in the H-series Guardian environment, and not in the H-series OSS
environment.) However, native executable files running in a native environment still
perform significantly faster than TNS-accelerated files running on the same system.
The TNS/R and TNS/E native environments support position-independent code (PIC)
files, which enable programmers to create and use dynamic-link libraries (DLLs). By
default, the TNS/R native C compiler creates non-PIC object files; a compiler option
flag is required to create PIC object files. The TNS/E native C compiler creates only
PIC object files; non-PIC files are not supported in the TNS/E native environment.
Native object files (PIC and non-PIC) cannot be linked together with TNS interpreted
object files or with TNS accelerated object files to create an executable file. PIC files
cannot be linked with non-PIC files.
Executable files created by the TNS/R native C compiler can run only on a D40.00 (or
later) TNS/R native system; they cannot run on a TNS system, a TNS/R system earlier
than D40.00, or a TNS/E system. Executable files created by the TNS/E native C
compiler can run only on an H06.01 or later TNS/E native system; they cannot run on a
TNS system or on a TNS/R system.
The native C compilers accept only filenames that are correct for the compilation
environment. For example, when running in the OSS environment, only OSS
pathnames are recognized.
Compilation Options for C and C++ Programs
With the introduction of the native C compilation tools, the OSS programmer has a
greater selection of environments in which to develop and compile C and C++
programs. This subsection describes the TNS/R native, TNS/E native, and G-series
TNS C compilation tools. Compilation steps and options are provided later in this
section.
You can develop TNS/R native programs on either a TNS/R or TNS/E platform. The
H-series RVUs support the TNS/R compilation tools, allowing you to compile and link
TNS/R native programs on a TNS/E native system; however, you must transfer the