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

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:
Bits in MantissaC Compiler Flag or MacroExecution Environment
113__IEEE_FLOATHP Tru64 UNI
113__IEEE_FLOATHP OpenVMS
106__LONGDOUBLE128IBM AIX
53-WIEEE_floatOpen System Services
113Sun Solaris 7 on SPARC
64Sun Solaris 7 on Intel x86
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.
C Compilation on a Workstation
Many C compilers are available from workstation vendors, from public domain software suppliers,
and from third-party software vendors. The C compilers and utilities discussed in the following
paragraphs are used only as examples. Some of these may not exist on the platforms available to
you.
The C compilers discussed in the following subsections are commonly available on UNIX
workstations:
“Sun C Compiler” (page 166)
“GNU C Compiler” (page 167)
Sun C Compiler
The Sun C compiler (an optional product on many Sun workstations) is fully ISO/ANSI C compliant
and runs on SunOS as well as Solaris. It supports the following:
These ISO/ANSI C predefined macro names:
__STDC__
__TIME__
__DATE__
__LINE__
166 Porting From Specific UNIX Systems