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

Table Of Contents
Porting From Specific UNIX Systems
Open System Services Porting Guide520573-006
9-6
Development Tools
Standard and Alternate Library Directories
Libraries on a UNIX workstation are usually kept in the /usr/lib and /lib
directories. The OSS file system provides the same directory structure, so that ported
applications can keep their libraries in the same locations.
You should check the location and content of libraries on the system you are porting
from and on the system you are porting to. If your UNIX system does not keep its
libraries in /usr/lib and /lib, or if it uses other implementation-defined library
directories, you might need to compensate when you link a ported program in the OSS
environment.
To look for a library routine on your workstation, check /usr/lib, then /lib, then
alternate library directories. If your workstation compiler is ISO/ANSI compliant, it
should have a -L flag. The -L flag can be used to search for your own versions of the
library routines. The HP C compiler supports the -L flag.
The object modules in the OSS versions of the standard C library include the system
calls and the standard run-time routines provided by many UNIX systems. The
standard C library is searched by default when the C compiler invokes the nld, ld, or
eld linker to build an executable program; when you invoke nld, ld, or eld directly,
you must explicitly specify the standard C library.
Implementor-Defined Values
Part of an application program environment depends on the vendor’s interpretation of
standards and specifications. Such interpretations exist when a value must be
determined by the system architecture or when the standards body could not agree on
a single behavior for a feature of a function or command.
Programs that push the limits of a system can exhibit behavior differences when ported
to another platform. For example, if you have a C program that is dependent on the
number of digits in the mantissa of a long double-precision floating-point value
(LDBL_MANT_DIG), you need to consider the following implementation differences:
Locate header files such as limits.h and float.h on the system you are porting
from and the system you are porting to. (For the OSS environment, selected values
can be found in the float(4) and limits(4) reference pages either online or in
the Open System Services System Calls Reference Manual.) Compare the values
defined for any critical implementation-defined symbols.
Execution Environment C Compiler Flag or Macro Bits in Mantissa
HP Tru64 UNIX
® __IEEE_FLOAT 113
HP OpenVMS __IEEE_FLOAT 113
IBM AIX __LONGDOUBLE128 106
Open System Services -WIEEE_float 53
Sun Solaris 7 on SPARC 113
Sun Solaris 7 on Intel x86 64