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
Porting UNIX Applications to the OSS Environment
Open System Services Porting Guide—520573-006
7-19
Using OSS Function Calls
Using OSS Function Calls
The OSS function calls specified by the POSIX.1 and POSIX.2 standards are
compliant with those standards. However, the POSIX standards do allow for
implementation-defined behavior, which is described in this subsection. UNIX
application programs ported to the OSS environment might be affected by this
behavior. Because many of the OSS file system and process-control function calls can
also manipulate Guardian objects, access to Guardian objects can affect the behavior
of the function call. Some error codes can be returned by these function calls that
would not be returned in a UNIX environment. These errors are documented in the
online reference pages for the OSS function calls.
OSS File Function Calls
Most file-related function calls that implement the POSIX standards or the XPG4
specifications have no side effects or implementation-defined behavior when used with
OSS files. Some of these function calls on Guardian files behave differently from the
same operations on OSS files.
The Guardian files that can be operated on are limited to odd-unstructured, EDIT, and
terminal emulation processes. Access to files is determined by the security model of
the object. Guardian files are protected by the Guardian security model; OSS files are
protected by the POSIX.1 security model. The file-related function calls that exhibit
implementation-defined behavior or which behave differently when manipulating
Guardian files are discussed following.
Using the access() Function
For the access() function call, the behavior on OSS files is defined by the POSIX.1
standard with minor implementation-defined behavior. When the filename resolves to
the /G directory, the permissions are “r-xr-xr-x.” For Guardian volumes and
subvolumes, the permissions are “rwxrwxrwx.” For a Guardian disk file, Guardian
standard security and Safeguard file-level protection govern access.
Using the chdir() Function
The chdir() function call has no implementation-defined behavior on OSS
directories, but it does exhibit some Guardian specific behavior. chdir() can point to
a nonexistent (empty) Guardian subvolume, but pointing to a Guardian subvolume with
a reserved name such as /G/zyq00001/z000002h results in an error.
Using the chmod() Function
The effect of the chmod() function call on open files is implementation-defined,
according to the POSIX.1 standard. A call to chmod() has no effect on the file
descriptor for a file that is open at the time of the call. New openers of the file are
authenticated using the new access permissions specified in the call. An attempt to set
the permission bits on a Guardian file results in an error because Guardian security
rules apply.