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
OSS Porting Considerations
Open System Services Porting Guide—520573-006
6-3
The poll() Function
The poll() Function
On a UNIX system, the poll() function provides applications with a mechanism for
multiplexing input and output (blocking I/O) over a set of file descriptors. It identifies
those file descriptors on which an application can read or write data, or on which
certain events have occurred. poll() supports regular files, terminal devices, sockets,
STREAMS-based files, FIFOs, and pipes.
If your program calls poll(), you must use the select() function or the Guardian
FILE_COMPLETE_ procedure call instead. The select() function supports only
OSS file descriptors, while the FILE_COMPLETE_ procedure supports both OSS file
descriptors and Guardian file numbers. For more information on the select()
function, refer to the select(2) reference page either online or in the Open System
Services System Calls Reference Manual; for more information on the
FILE_COMPLETE_ procedure, refer to the Guardian Procedure Calls Reference
Manual.
TLI/XTI
The Transport Layer Interface (TLI), as defined in UNIX System V Release 4 (SVR4),
is a transport independent interface that supports many transport interfaces, such as
TCP/IP, OSI TP4, IPX/SPX, and others. X/Open specifies XTI, with some minor
enhancements; XTI is a superset of TLI. Both interfaces are similar to the ISO
transport service definition and provide functions similar to those provided by sockets.
Open System Services does not support TLI or XTI. You must use an alternative
approach: for example, rewriting some parts of your code to use Guardian sockets.
The steps used by a sockets interface when listening for incoming calls and
establishing transactions are very similar to TLI or XTI, but the routines use different
semantics. Thus, it is not difficult to modify a program that uses TLI/XTI to use a
Guardian sockets interface instead.
Using Interprocess Communication (IPC)
Mechanisms
Most versions of UNIX possess many IPC mechanisms. When porting code to the
OSS environment, there is not always a complete correspondence of these IPC
mechanisms and other features.
Table 6-2 on page 6-4 lists the IPC methods available in Open System Services using
only the OSS APIs and the capabilities of each API relevant to communication
between processors and nodes.