Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
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 chapter 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” (page 85)
• “Using Interprocess Communication (IPC) Mechanisms” (page 88)
• “Memory Model Considerations” (page 94)
• “Considering Design Trade-Offs” (page 95)
• “Using Process-Creation Calls” (page 96)
• “Performing File Operations” (page 100)
• “Porting Servers and Demons” (page 103)
You should also read Chapter 3 (page 48), and Chapter 7 (page 107), before starting to port any
program to the OSS environment. Chapter 3 (page 48) discusses using code analysis programs
to identify features of your code that are not present in the OSS environment. Chapter 7 (page 107),
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.
NOTE: Beginning with the H06.24 and J06.13 RVUs, 32-bit OSS and Guardian programs can
be converted to 64-bit OSS programs. For information about creating 64-bit OSS programs, see
the 64-Bit Support in OSS and Guardian chapter in the Open System Services Programmer's
Guide.
UNIX Features Requiring Substitution
Table 5 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 chapter includes a discussion of each feature
listed.
Table 5 UNIX Features and the OSS Environment
RecommendationFeature
Use the OSS sockets library; refer to “Using Sockets”
(page 89) and to Chapter 11 (page 178)
Berkeley sockets
Recode your applicationMemory mapped files
Use malloc() instead of brk() and sbrk(); refer to
“Memory Allocation and Deallocation” (page 95) for more
information
Memory allocation
Use user-level threads (sometimes called pthreads)Multiple threads in applications
Use with shared memory, in single-processor operationsSemaphores
Recode, use Guardian sockets librarySTREAMS
Recode, use Guardian sockets libraryTLI/XTI
If you must recode your program to achieve feature equivalence in the OSS environment, always
try to conform to the POSIX standards and XPG4 specifications; see “Porting Is Easier When
UNIX Features Requiring Substitution 85