xopen_networking.7 (2010 09)
x
xopen_networking(7) xopen_networking(7)
NAME
xopen_networking - X/Open Networking Interfaces
DESCRIPTION
X/Open has defined Sockets and IP Address Resolution interfaces in X/Open CAE Specification, Net-
working Services, Issue 4 (UNIX 95), X/Open CAE Specification, Networking Services, Issue 5 (UNIX 98),
and The Single UNIX Specification, Version 3, System Interfaces (UNIX 03).
X/Open has also defined XTI in X/Open CAE Specification, Networking Services, Issue 4 (UNIX 95) and
X/Open CAE Specification, Networking Services, Issue 5 (UNIX 98). Beginning in UNIX 03, XTI is no
longer part of The Single UNIX Specification .
For more information on the specifications or a detailed description of the X/Open Networking Interfaces,
please refer to the above specifications at
The Open Group website, http://www.opengroup.org
.
Prior to HP-UX 11i v3, HP-UX is certified to UNIX 95 on PA-RISC and Integrity systems. Beginning with
HP-UX 11i v3, HP-UX is certified to UNIX 95 on PA-RISC systems and to UNIX 95 and UNIX 03 on
Integrity systems.
COMPILATION ENVIRONMENT
There are two ways to obtain X/Open Sockets functionality:
Method A is in compliance with X/Open compilation specification.
Method B slightly deviates from X/Open compilation specification. However, Method B allows a pro-
gram to include both objects compiled to X/Open Sockets specification and objects compiled to BSD
Sockets specification.
Either
cc, c89 or c99 utilities can be used. Refer to cc(1) for details. Also note certain features in
UNIX
03 are only available if c99 is used. For example, the "restrict" qualifier for pointers is only available if
c99 is used.
Method A) Strict Compliance Method
An X/Open conforming application is one that has all its parts compiled and built according to X/Open
specifications. For such conforming applications, this compilation method would be appropriate.
Compilation
UNIX 03
Applications should ensure that the feature test macro
_XOPEN_SOURCE
is defined with the value 600.
To ensure portability, applications should define the macro either on the compilation command line, or at
the beginning of each source module prior to the inclusion of any headers.
For example, to compile a 64 bit object using
HP ANSI Compiler:
c99 +DD64 -D_XOPEN_SOURCE=600 -c main.c -o main.o
c99 +DD64 -D_XOPEN_SOURCE=600 -c routines.c -o routines.o
UNIX 95
Applications should ensure that the feature test macros _XOPEN_SOURCE and
_XOPEN_SOURCE_EXTENDED are defined. To ensure portability, applications should define the macros
either on the compilation command line, or at the beginning of each source module prior to the inclusion
of any headers.
For example, to compile a 64 bit object using
HP ANSI Compiler:
c89 +DD64 -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -c main.c -o main.o
c89 +DD64 -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -c routines.c -o
routines.o
Linkage
Link the program objects with Xnet library.
For example:
ld main.o routines.o -lxnet -lc -o prog
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1