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-22
Using PROCESS_SPAWN_ in a Guardian Program
Using PROCESS_SPAWN_ in a Guardian Program
Another way to start OSS programs from the Guardian environment is to use the
PROCESS_SPAWN_ procedure call in a Guardian program from the TACL command
interpreter. This method is a much more direct means of starting an OSS process from
the Guardian environment, because the OSS shell command interpreter is not
involved.
A new OSS process is created optionally with an assigned name, with the caller
becoming the Guardian parent of the OSS child process. The caller will be notified of
child process termination through a system message on $RECEIVE, not through an
OSS SIGCHLD signal.
DEFINEs can be propagated to the new process. OSS processes can be created in a
waited or nowait manner. The files to be opened in the new process must be specified
in a file descriptor structure that is passed as an argument to the call. Certain
inheritance features and process attributes can be specified for the OSS process
created. An example of how this Guardian procedure can be used to start up an OSS
process from the Guardian environment is shown in the Open System Services
Programmer’s Guide.
Another benefit of using PROCESS_SPAWN_ to create an OSS process from the
Guardian environment is that when the calling process is a Guardian monitor process
pair, the monitor can ensure that an OSS child process is restarted if it stops. The OSS
child process can be considered to be a persistent process in this case. Because the
PROCESS_SPAWN_ procedure can be used to create an OSS process in a nowait
manner, the calling process can continue processing while the child process is being
created. More information on managing OSS processes from the Guardian
environment is available in the Open System Services Programmer’s Guide.