Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Open System Services Porting Guide520573-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