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
Porting UNIX Applications to the OSS Environment
Open System Services Porting Guide—520573-006
7-13
Defined Symbols and Header Files
environment. In addition, the following header files are provided to define the interfaces
to HP extensions:
The contents of the header files in the OSS environment in /usr/include are
identical to the contents of the header files in the Guardian environment in
$SYSTEM.SYSTEM. These files support the OSS and the Guardian environments.
The system entry points are different for the same external run-time routine for each of
the memory models. The proper entry point to the system is determined by the use of
the appropriate compiler-defined symbols. In general, you do not need to be concerned
with how the proper entry point is selected in the header files. This selection is handled
by using the appropriate pragmas in the source code and symbol definitions in the
compiler command line. Defaults are used in each environment. Different memory
models used between the OSS and Guardian environments is not an issue in the
native environment, because both use the WIDE data type.
Feature-Test Macros
Feature-test macros determine which set of features is included in header files. The
following feature-test macros can be used in the OSS environment:
cextdecs.h Function prototype declarations for the Guardian procedures
sql.h Embedded SQL/MP definitions and some SQL/MX data-type
declarations
sqlcli.h Declarations for the SQL/MX C/C++ preprocessor of the command
line interface functions and data structures (provided automatically
by the preprocessor; #include is not required)
tal.h TAL condition code macros
tdmext.h Function call definitions for HP extension functions
tdmstd.h HP pragmas and toggles
__STDC__=1 When defined, all symbols defined by ISO/ANSI
C are always made visible, by default. This
macro is not defined by the user; the compiler
defines it, signifying compliance with ANSI/ISO
C. __STDC__=1 is not defined when the user
invokes the compiler to use the Common C
compiler. (Note that there are two underscores,
“__”, before and after “STDC.”)
_POSIX_SOURCE
or
_POSIX_C_SOURCE=1
When defined, all symbols defined by POSIX.1
are visible.
_POSIX_C_SOURCE=2 When defined, all symbols defined by POSIX.1
and POSIX.2 are visible.