Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
Porting or Migrating Sockets Applications
Open System Services Porting Guide—520573-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