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-10
Accessing Files From the Guardian API
Odd-unstructured files and EDIT files are opened as OSS regular files.
If you want your application to modify odd-unstructured Guardian files, or if your
application uses data stored in odd-unstructured Guardian files or EDIT files, you can
use the interoperability capabilities of the OSS environment and access these files with
OSS functions. If you need to modify EDIT files or open structured files, you can use
Guardian procedures as described in Accessing Files From the Guardian API on
page 5-10.
As an alternative to using Guardian procedures when you cannot accomplish a task
with OSS functions, you might be able to accomplish the task with the Guardian C
functions. Write a separately compiled module using Guardian C functions and link this
module into the OSS program. Whether you can do this depends on whether you can
accomplish the required set of operations with Guardian C functions. Refer to the Open
System Services Programmer’s Guide for more information about calling Guardian C
functions from OSS programs; it includes examples of reading a Guardian file with an
OSS function call.
Accessing Files From the Guardian API
Guardian files can be managed from the Guardian API as described in the Guardian
Programmer’s Guide and the Guardian Procedure Calls Reference Manual.
OSS files can also be managed from the Guardian API. You would use Guardian
procedures to access OSS files when you need to perform operations that use the
nowait feature of the Guardian environment.
Nowait I/O is the ability of an application process to continue executing in parallel with
read and write operations; the application process runs concurrently with the I/O
operation. The OSS environment uses waited I/O, where an application process is
suspended during read and write operations. The process does not resume execution
until the I/O operations are complete. Nowait I/O does not work on files that have been
opened with the OSS open() function.
When you use a Guardian I/O procedure in nowait mode, you set the maximum
number of concurrent I/O operations that you want to allow and then complete the I/O
operations by calling the AWAITIO[X] procedure. For details on using nowait I/O with
Guardian procedures, refer to the Guardian Programmer’s Guide. The Open System
Services Programmer’s Guide contains an example of using the AWAITIO[X]
procedure to read an OSS file.