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-7
Include File Search Order
The use of header files is optional (but strongly recommended) for programs that
contain Guardian modules exclusively. However, using header files is required for
mixed-module programs: for example, when an OSS module is bound into a Guardian
program. If compilation is done without using header files, the linker cannot correctly
resolve external references to Guardian and OSS functions.
Include File Search Order
In the Guardian environment, the SSV pragma specifies a search list of subvolumes for
files specified in the #include directives. In the OSS environment, the -I flag with
the c89 utility specifies a search list of directories for files specified in #include
directives. Refer to the c89(1) reference page either online or in the Open System
Services Shell and Utilities Reference Manuall for the details.
Using Pragmas
Some of the compiler pragmas used in Guardian C or C++ programs do not apply to
programs compiled in the OSS environment; they are ignored or generate an error
when the c89 utility is used.
You can remove these pragmas from the source files if you compile with the c89 utility:
Preprocessor Symbols
The native and TNS C compilers provide three predefined preprocessor symbols:
__TANDEM, __INT32, and __XMEM.
You can use __TANDEM to increase the portability of your C programs. (Enclose
system-dependent source text in a section that uses #ifdef or #ifndef directives to
test for the existence of __TANDEM.)
For the TNS environment, __INT32 (for int defined as 32 bits) is defined by the C
compiler when the WIDE pragma is present; __XMEM (for the large-memory model) is
defined by the C compiler when the XMEM pragma is present. For the native
environment, these two symbols are always defined.
Note. The native C compilers can be directed to accept C source files conforming to Kernigan
and Ritchie (K&R) C or Common C in addition to ISO/ANSI C. However, HP does not provide a
complete set of header files that conform to K&R C. The user must modify existing header files
or obtain files from another source to compile K&R C source files.
RUNNABLE Generate executable object file.
SEARCH Search object file to resolve external references (used with RUNNABLE).
SSV Specify list of search subvolumes for files in #include directives.
NOXMEM Select small memory model (TNS only).
NOWIDE Select 16-bit data model (TNS only).