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-4
Porting Guardian Sockets Applications to the OSS
Environment
A BSD sockets application using nonblocking socket input/output can be easily
ported to the OSS environment with one minor change. In the UNIX environment, a
socket is marked as nonblocking by calling the fcntl() function for the socket
descriptor and using the function’s F_SETFL command to set the FNDELAY flag.
The OSS environment does not support the FNDELAY flag; instead, an OSS
application calls fcntl() and sets the O_NONBLOCK flag to mark a socket as
nonblocking.
•
inetd activated services
Applications using inetd activated services can generally be ported to the OSS
environment with minimal changes, provided the General Considerations on
page 11-1 are observed. For more information, refer to Starting an OSS Server
Process on page 6-26.
Porting Guardian Sockets Applications to the
OSS Environment
The following subsections discuss:
•
General Considerations on page 11-4
•
Differences Between OSS Sockets and Guardian Sockets on page 11-5
•
Compiling Native and TNS OSS Programs on page 11-7
Additional considerations and sample programs can be found in the Open System
Services Programmer’s Guide.
General Considerations
The following is a list of general considerations for porting a sockets program from the
Guardian environment to the OSS environment:
•
Guardian programs can use 32-bit or 16-bit integers. OSS C programs use only
wide memory model 32-bit integers.
Most sockets routine arguments are of type int. If your program used the small
memory or large memory model in the Guardian environment, where the size of
the sockets library int is 16 bits, the program needs to be modified to use 32 bits;
int arguments such as socket_number and length are 32 bits in the OSS
environment instead of 16 bits. If you have declared these arguments as int
throughout your program, no changes to them should be required. If you have
used any other C declaration type, such as short for a sockets routine argument,
then your program must be changed accordingly.
For more information on converting programs to use the 32-bit data model, refer to
the C/C++ Programmer’s Guide.