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
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide—520573-006
8-31
Replacing Guardian Procedure Calls With
Equivalent OSS Functions
•
$RECEIVE processing functions cannot be used to access process startup
sequence information, including ASSIGNs and PARAMs. ($RECEIVE processing
functions can continue to be used for interprocess communication.)
These restrictions must be taken into consideration when migrating a Guardian
program to the OSS environment.
Replacing Guardian Procedure Calls With Equivalent OSS
Functions
To make the program as open as possible and, therefore, portable to other UNIX
environments, you may want to replace some of the Guardian procedure calls with
equivalent OSS C library run-time calls or OSS system calls. There is no one-to-one
replacement mechanism that can be recommended for the Guardian procedure calls.
The OSS file system routines are limited to dealing with odd-unstructured files, EDIT
files, and terminals. Thus, programs which need to deal with other kinds of files will
need to continue to use the Guardian procedures.
The OSS process-management routines deal with process IDs rather than with
process handles. Thus, programs which use Guardian process-management routines
will need modifications to use the equivalent OSS process-management routines.
Because process termination is done with system messages in the Guardian
environment, and with exit() status and SIGCHLD signal in the OSS environment,
the logic of the Guardian program will need to be modified accordingly to work in the
OSS environment. Because most Guardian system procedure calls will continue to
work in the OSS environment as they did in the Guardian environment, a complete
replacement of Guardian system procedure calls with equivalent OSS system calls and
run-time routines is not necessary.
Which IPC Mechanisms Can Be Used
The IPC mechanisms available to a Guardian program for communicating with other
Guardian programs and with OSS programs are generally available to an OSS
program as well. The use of $RECEIVE still requires using Guardian procedure calls,
but Guardian sockets can be used in OSS programs in the same way they are used in
Guardian programs. Pipes can be used between two related OSS processes, whereas
they cannot be used in the Guardian environment. Files and queue files can be used in
the OSS environment in the same manner as they are used in the Guardian
environment. The use of OSS shared memory and OSS semaphores is encouraged
when communicating between two OSS processes, but flat segments can be shared
between OSS and Guardian processes using Guardian procedure calls as well.
Interactions Between Guardian and OSS Functions
There is a common problem associated with some forms of interprocess
communication (including death notification) between processes of differing Guardian
and OSS types. This is referred to as the “exec problem.” You must be aware of this
issue when mixing OSS and Guardian IPC functions within an OSS program.