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
OSS Porting Considerations
Open System Services Porting Guide—520573-006
6-19
Opening an OSS File
Opening an OSS File
A file open operation for an OSS file involves a number of steps. If the file specified in
the open request does not exist, it is created (if the O_CREATE flag is set). The
following steps are involved in opening an OSS file:
1. An application uses the open() function call to open an OSS file named /a/b.
The OSS file system sends an open request to the OSS name server.
2. The OSS name server receives the open request and attempts to map the OSS
pathname to a Guardian filename. This mapping step involves a file lookup step
with the catalog.
3. The OSS name server replies to the client with a filename in the Guardian filename
format ($DATA.ZYQ00000.Z000002H). Accessing the catalog (involving a disk
access) is not done when opening a Guardian file. (Because of the caching in the
OSS name server, catalog access during open processing might not be needed.)
4. Now equipped with a Guardian filename, the OSS file system sends an OSS open
message to the appropriate DP2 disk process.
This process and the related closes can involve many resources when done for many
files. See Performance Considerations for Files on page 6-20 for conserving system
resources.
Extra Steps for Creating Files
The extra steps for opening OSS files involve the pathnames translation performed by
the OSS name server. The catalog accessed is an Enscribe database describing the
files in the fileset. Each OSS fileset has a catalog. For the OSS fileset, each OSS file
has an entry in a catalog, as does each filename.
Creating a file involves a few more steps than opening an existing OSS file. Similar to
opening a file, the application (client) sends an open request to the OSS name server,
which determines that the file does not exist. The OSS name server picks a volume
and creates a file by sending an OSS create call to the DP2 disk process; it creates a
catalog entry for the file and responds to the application with the created filename. The
application then can open this file by sending an OSS open request to the DP2 disk
process.