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
Introduction to Porting
Open System Services Porting Guide—520573-006
1-2
Porting Is Easier When Standards Are Used
programming practice is to write your C or C++ programs using a template with items
included in the source file in the following order:
•
Feature test switches: define the _POSIX_SOURCE macro.
•
System headers: those that must be included to define symbols used by a function.
•
Local headers: define common data structures and symbols
•
Macros: defined here with comments to describe the macros.
•
File scope variables: those that are shared by several functions in the same file.
•
External variables: those defined in other modules but used in current module.
•
External functions: list external functions used by each module.
•
Structures and unions: define structures used in current file.
•
Signal catching functions: keep signal catching functions in this area.
•
Functions: define functions before use.
•
Main: if present, place the main() function last.
Porting Is Easier When Standards Are Used
The OSS environment is based upon standards available in the open systems
community. These standards include the POSIX standards, XPG4 interface
specifications, and the ISO/ANSI C compiler language standard. The prime purpose of
these standards is to define a consistent interface and environment for application
programs. Using standard interfaces enhances the portability of your applications to
open systems environments.
The following subsections describe the relevant standards:
•
POSIX Standards and OSS Conformance on page 1-2
•
XPG4 Specifications and OSS Compliance on page 1-4
•
OSS Compliance With UNIX 98 and Other Open Group Technical Standards on
page 1-4
•
ISO/ANSI C Standard and the HP NonStop C Compiler on page 1-4
POSIX Standards and OSS Conformance
POSIX (Portable Operating System Interface) is a group of formal standards
introduced by the IEEE in the mid-1980s. POSIX is a whole family of formal standards
defining the interface between applications and a set of system libraries. The OSS
environment is nearly completely compliant with the 1990 editions of the basic
POSIX.1 and POSIX.2 standards. For more information, refer to the ISO/IEC 9945-1
POSIX.1 Standard and ISO/IEC 9945-2 POSIX.2 Standard documents.
POSIX.1 Standard
POSIX.1 defines interface standards that make up the application program interfaces
(APIs). It defines the APIs to be used by portable programs, the system call interface,
and the C run-time routine interfaces for portable programs. If programs use only those
APIs, they are guaranteed to be portable to other POSIX-conforming environments.