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

Table Of Contents
Porting UNIX Applications to the OSS Environment
Open System Services Porting Guide520573-006
7-3
Porting Analysis
Compatibility can be achieved between systems using similar processors and standard
transport media formats, but is rarely achieved between two dissimilar hardware
architectures (except with much care).
Portability Through Operating Environment Compatibility
Operating environment compatibility exists when two operating systems support or can
emulate a sufficiently complete mutual subset of operating system and support function
calls. This compatibility includes features necessary for developing target applications,
but may not include facilities that are hardware-independent in principle or that are
used only for system maintenance. Strong operating system compatibility exist among
most vendors’ UNIX systems: most are compatible with the XPG4 specifications.
Porting Analysis
One of the first things you should do before starting a porting task is determine the
level of effort necessary to perform the port. The ease of the porting task depends
largely on the compatibility between the C compilers and the operating system
interfaces used in the two environments. By using the proper set of tools, you can
identify the areas that need the most attention in performing the port:
The lint program, found on most UNIX systems, finds bad constructs in
C programs. It identifies variables used before they are set, unreachable program
segments, and functions that return unused values.
A findcalls tool performs a simple lexical analysis of C source code by
searching for the use of function calls. By comparing function calls, findcalls
identifies the function calls not supported by the target environment and that
therefore need replacing by equivalent function calls.
A third-party tool, CodeCheck, checks program source code for compliance with
ISO/ANSI C, POSIX.1, and POSIX.2 standards. Another third-party tool, Open
Systems Portability Checker (OSPC), does a thorough source code check for
ISO/ANSI C compliance and a number of POSIX standards by using profile
specifications.
These tools are further described in Section 3, Useful Porting Tools.
Design Trade-Offs
All of the standard functions in the OSS environment behave according to open
specifications, but because the OSS environment is based on the NonStop operating
system, the performance of some of these functions might be different than in other
UNIX environments. For example, the cost (time and resources) to create a process is
higher in the OSS environment than in most UNIX environments. This factor can result
in different performance among programs that create many processes
To improve performance, redesign your program to use persistent processes for each
major function rather than create a new process to perform the function. The design