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
Interoperating Between Programming Environments
Open System Services Porting Guide—520573-006
5-11
Guardian Procedures Extended for OSS Files
Guardian Procedures Extended for OSS Files
Some Guardian file system procedure calls are extended to manipulate OSS files:
•
FILE_GETINFO_
•
FILE_GETINFOBYNAME_
•
FILE_GETINFOLIST_
•
FILE_GETINFOLISTBYNAME_
•
FILE_OPEN_
•
FILE_OPEN_CHKPT_
•
SETMODE
The FILE_GET* procedures determine whether a file is an OSS file or a Guardian file.
Additionally, each provides slightly more specialized information. For instance, the
FILE_GETINFO_ procedure obtains a limited set of information about a file identified
by file number, and FILE_GETINFOLIST_ obtains detailed information about the file
identified by file number. The Guardian FILE_GETINFOBYNAME_ procedure identifies
Guardian objects, file attributes, processes, terminal names, and tape devices.
The FILE_OPEN_ procedure establishes a communication path between an
application process and a file; it also returns a file number to the caller. The file number
identifies the access path to the file in subsequent file-system calls. The FILE_OPEN_
procedure can be used to open OSS files. When it is used with the READX and
AWAITIOX procedures, data is read from an OSS file in nowait mode. The
FILE_OPEN_CHKPT_ procedure opens a designated file for a backup process.
The SETMODE procedure is used to set device-dependent properties.
Details on how to use these calls are provided in the Guardian Procedure Calls
Reference Manual. Also, examples for using some of these procedures are included in
the Open System Services Programmer’s Guide.
Native Signal Interoperability
Signals are software interrupts that provide a way of handling asynchronous events,
such as a user at a terminal typing an interrupt key, timer expiration, or abnormal
termination of a process.
Both OSS and Guardian native processes can send, receive, and handle signals using
the functions in the OSS API, which conform to the POSIX.1 standard. However, there
are some important differences, (mostly with respect to how Guardian processes
interact with signals) which are summarized as follows:
•
Control of a process over itself and other processes: an OSS process can control
(or send a signal to) itself using a function such as raise(), abort(), or
sleep(). An OSS process can also exercise control over another OSS process
by sending a signal to it using the kill() function.
A Guardian native process can use most of the signal functions in the OSS API to
send, receive, and handle signals but only for the purpose of exercising control