Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

Using Functional Equivalents
The fewer nonstandard functions used by a program, the more portable it is. A program becomes
increasingly more difficult to port to multiple environments as it uses functions in more of the
categories in the order listed below:
ISO/ANSI C
POSIX.1
POSIX.2
XPG3
XPG4
XPG4 Version 2
Single UNIX Specification
HP extensions to OSS functions
HP extension OSS functions
Guardian functions
When a program uses nonstandard functions not in the set of functions included in ISO/ANSI C,
POSIX.1, or XPG4, functionally equivalent functions must be used when porting the program to
the OSS environment. The suggested list of functionally equivalent functions listed in Table 8 can
be used if the program uses one of the nonstandard functions listed in the “Function” column.
The functions listed under “Function in Table 8 are not currently provided in the OSS environment.
Therefore, they must be replaced by the functionally equivalent functions (“Replacement
Recommendation”).
Table 8 Functions Currently Not in the OSS Environment
Replacement RecommendationFunction
Use malloc() and free().alloca()
Use sqrt(x*x + y*y).cabs()
Use fcntl().flock()
Use getpwent().getpw()
Use kill() with a negative process group ID.killpg()
Use fcntl().lockf()
See “Memory Mapping” (page 86).mmap(), munmap()
Use Guardian sockets with nowait I/O.poll()
Use setvbuf().setbuffer()
Use alarm().setitimer()
Use setvbuf().setlinebuf()
Use sigprocmask().sigblock()
Use sigsuspend().sigpause()
Use sigprocmask().sigsetmask()
Use sigpending().sigvec()
Use localtime().timezone()
Use utime().utimes()
Using Functional Equivalents 111