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-18
$RECEIVE
•
Using Shared Memory on page 8-19
•
Using Semaphores on page 8-19
•
Using Intermediate Processes on page 8-20
•
Using Signals on page 8-20
The proper use of the appropriate IPC mechanisms enables a Guardian process to
communicate with an OSS process, giving it greater access to the open environment.
See also the Using Interprocess Communication (IPC) Mechanisms on page 6-3.
Processes running on different nodes in a network can communicate only by using the
Guardian $RECEIVE file or Guardian sockets. Using Guardian sockets is encouraged
because sockets are the most widely used interface for interprocess communication
between heterogeneous computer systems. However, when a Guardian or OSS
process must communicate with a process on another node already using its
$RECEIVE file to get system messages and messages from other processes, the
Guardian process should communicate with that process using its $RECEIVE file.
$RECEIVE
Guardian and OSS processes can communicate with each other using $RECEIVE to
receive messages from other processes or system messages. The process acting as
the server must be a named process and use the FILE_OPEN_ procedure to open the
$RECEIVE communication channel. The process acting as the requester must use the
FILE_OPEN_ procedure to open a communication channel to the named server
process. A named OSS process can be created by:
•
Using tdm_fork(), tdm_execve(), or tdm_spawn() from another
OSS process
•
Using the PROCESS_SPAWN_ procedure from a Guardian process
•
Using the run command within the OSS shell
•
Using the osh command with the -name option from the Guardian environment
When $RECEIVE is used, system messages can arrive on it; the program must be
prepared to deal with them. The server or requester can be an OSS process. It is
common for the requester/server relationship to be that the requester opens the server
and writereads to the server. The server manages the opens issued by the requester.
Sample programs using $RECEIVE are included in the Open System Services
Programmer’s Guide.
Using FIFOs
Guardian and OSS processes can communicate through FIFOs because a FIFO has a
name that both processes can see and open. The Guardian process must open the
FIFO using the OSS C fopen() function because the FIFO exists in the OSS file
namespace.