Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
The contents of the header files in the OSS environment in /usr/include are identical to the
contents of the header files in the Guardian environment in $SYSTEM.SYSTEM. These files support
the OSS and the Guardian environments.
The system entry points are different for the same external run-time routine for each of the memory
and data models. (For more information about memory and data models, see “Memory and Data
Models in TNS and Native Environments” (page 140).) The proper entry point to the system is
determined by the use of the appropriate compiler-defined symbols. In general, you do not need
to be concerned with how the proper entry point is selected in the header files. This selection is
handled by using the appropriate pragmas in the source code and symbol definitions in the compiler
command line. Defaults are used in each environment.
Feature Test Macros
Feature test macros determine which set of features is included in header files. The following feature
test macros are related to C programs and can be used in the OSS environment. (Other feature
test macros enable specific HP extension functions or features. See “Using HP Extensions” (page 129))
When defined, all symbols defined by ISO/ANSI C are always made
visible, by default. This macro is not defined by the user; the compiler
__STDC__=1
defines it, signifying compliance with ANSI/ISO C. __STDC__=1 is not
defined when the user invokes the compiler to use the Common C compiler.
(Note that there are two underscores, “__”, before and after “STDC.”)
When defined, all symbols defined by POSIX.1 are visible._POSIX_SOURCE or _POSIX_C_SOURCE=1
When defined, all symbols defined by POSIX.1 and POSIX.2 are visible._POSIX_C_SOURCE=2
When defined, all symbols defined by the POSIX User Thread (PUT) Model
library are visible. Must be used when building a threaded application
_PUT_MODEL_
based on the PUT Model library. Because thread-aware signal handling
is always enabled in the PUT Model library, the alarm() and signal()
functions are mapped to the PUT Model library versions of these functions
(similar to what the SPT_THREAD_SIGNAL and
SPT_THREAD_PRAGMA_SIGNAL defines do for the SPT library).
When defined, all symbols defined by the Standard POSIX Threads (SPT)
library are visible. Must be used when building a threaded application
_SPT_MODEL_
based on the Standard POSIX Threads library on systems running H06.21
or later H-series RVUs or J06.10 or later J-series RVUs.
When defined, all symbols defined by POSIX.1, POSIX.2, and XPG4 are
visible. The pragma SYSTYPE OSS defines the _XOPEN_SOURCE macro.
_XOPEN_SOURCE
When defined, all symbols defined by POSIX.1, POSIX.2, XPG4, and
XPG4 Version 2 are visible. Because the pragma SYSTYPE OSS defines
_XOPEN_SOURCE_EXTENDED
the _XOPEN_SOURCE macro, the OSS user must explicitly define
_XOPEN_SOURCE_EXTENDED to use the XPG4V2 functions, such as
strdup(), readlink(), symlink(), and others.Note that, even
though the OSS sockets APIs are defined in Version 1 of the XPG4
specification, you must define _XOPEN_SOURCE_EXTENDED to use them.
When defined, all symbols defined by HP are visible. The pragma
SYSTYPE GUARDIAN defines the _TANDEM_SOURCE macro.
_TANDEM_SOURCE
The TNS/R and TNS/E compilers define this macro, signifying that they
are invoked as C++ compilers instead of as C compilers. The user does
__cplusplus
not explicitly define this macro but chooses it when supplying the file suffix
of the source code; for instance, .C or .cpp means the file is compiled
with the C++ compiler. (Note that there are two underscores, “__”, before
“cplusplus.”) Refer to the c89(1) or the c99(1) reference page either
online or in the Open System Services Shell and Utilities Reference Manual
for acceptable file suffixes on input files for the c89 or c99 utility.
When defined, the identifiers used by the C compiler for the OSS
environment are identified. The user does not define or undefine this
macro, it is used only by the compiler.
_OSS_HOST
118 Porting UNIX Applications to the OSS Environment