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
Open System Services Porting Guide—520573-006
6-1
6 OSS Porting Considerations
Most of the major features supported in UNIX systems are supported in Open System
Services, but some are provided in different ways. This section discusses what to do
about certain features that are not present in Open System Services and how to use
features equivalent to those provided in other UNIX systems. The following topics are
discussed:
•
UNIX Features Requiring Substitution on page 6-1
•
Using Interprocess Communication (IPC) Mechanisms on page 6-3
•
Memory Model Considerations on page 6-10
•
Considering Design Trade-Offs on page 6-12
•
Using Process-Creation Calls on page 6-13
•
Performing File Operations on page 6-18
•
Porting Servers and Demons on page 6-23
You should also read Section 3, Useful Porting Tools, and Section 7, Porting UNIX
Applications to the OSS Environment, before starting to port any program to the OSS
environment. Section 3, Useful Porting Tools, discusses using code analysis programs
to identify features of your code that are not present in the OSS environment.
Section 7, Porting UNIX Applications to the OSS Environment, includes a discussion
on determining the scope of portability of your code, a very important consideration in
deciding whether to add nonportable code or features specific to HP to your program.
UNIX Features Requiring Substitution
Table 6-1 lists the features that do not exist in the OSS programming environment or
that differ from most UNIX implementations. If the code being ported to the OSS
environment uses one of these features, the recommended approach is given. This
section includes a discussion of each feature listed.
Table 6-1. UNIX Features and the OSS Environment
Feature Recommendation
Berkeley sockets Use the OSS sockets library; refer to Using Sockets
on page 6-5
and to Section 11, Porting or Migrating Sockets Applications, for
more information
Memory mapped files Recode your application
Memory allocation Use
malloc() instead of brk() and sbrk(); refer to Memory
Allocation and Deallocation on page 6-11 for more information
Multiple threads in
applications
Use user-level threads (sometimes called pthreads)
Semaphores Use with shared memory, in single-processor operations
STREAMS Recode, use Guardian sockets library
TLI/XTI Recode, use Guardian sockets library