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

Table Of Contents
Porting or Migrating Sockets Applications
Open System Services Porting Guide520573-006
11-8
Interoperability of OSS and Guardian Sockets in an
OSS Application
Interoperability of OSS and Guardian Sockets
in an OSS Application
An OSS sockets application might contain program modules that call Guardian sockets
functions as well as program modules that call OSS sockets functions, but only one
type of sockets functions (OSS or Guardian) can be used in a given module.
To compile an OSS application module that contains OSS sockets calls:
Define _XOPEN_SOURCE_EXTENDED as 1 at compile time.
Define _TANDEM_SOURCE in the module or at compile time. This toggle is not
needed for strictly compliant applications.
Link the module with the sockets SRL or DLL, or the static sockets library, if it uses
any of the Internet domain support functions listed in Table 11-3.
To compile an OSS application module that contains Guardian sockets calls:
Define _GUARDIAN_SOCKETS in the module or in the make file used to compile the
program.
Define _TANDEM_SOURCE in the module or in the make file used to compile the
module.
Link the module with the sockets SRL or DLL, or the static sockets library.
Internet domain sockets have an additional set of support functions: Internet domain
database query, socket end-point value query, and Internet address manipulation
functions. The SRL zinetsrl is provided for TNS/R native applications and the DLL
zinetdll is provided for TNS/E native applications; both reside in the
/G/SYSTEM/SYSnn directory. The static library /usr/lib/libinet.a is provided
for G-series TNS socket applications.
Table 11-3 summarizes these support functions. The functions are described in the
OSS reference pages online and in the Open System Services Library Calls Reference
Manual.
Table 11-3. Additional Internet Domain Support Functions (page 1 of 3)
Function Description
freeaddrinfo()
Frees an address information structure created
by a previous getaddrinfo() function call
freehostent()
Frees hostent structure previously allocated by
getipnodebyaddr or getipnodebyname
gai_strerr()
Aids applications in printing error messages
returned by getaddrinfo()
getaddrinfo()
Converts host names and service names to
socket address structures