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-20
Using OSS Function Calls
The value of the S_NONSTOP flag on a regular OSS file can be changed with chmod(),
but the change takes effect at the next open() call.
Using the chown() Function
For OSS files, a process can use the chown() function call to change the owner ID of
a file only if the effective user ID of the process is the super ID. The
_POSIX_CHOWN_RESTRICTED feature of this call is enforced for OSS files.
The ownership of Guardian disk files can be changed by using chown(), but attempts
to change the ownership of other Guardian files results in an error. The Guardian
security model is used, and any user can be given ownership of the file. Changing the
owner ID has the side effect of changing the group ID to the Guardian group of the new
owner. The _POSIX_CHOWN_RESTRICTED feature is ignored for files in the Guardian
file system.
Using the chroot() Function
The chroot() function changes the effective root directory. The chroot() function
can be called on the /G directory, a disk volume name, or a subvolume name. If a
process name or a reserved name is specified in the path parameter, the function fails
and returns an error.
Using the fcntl() Function
The fcntl() function controls open file descriptors. An OSS advisory lock can be
performed on Guardian regular files as well as on OSS files. Calling the fcntl()
function to unlock a Guardian file affects only OSS locks on that file. If the file has also
been locked by a Guardian procedure call, the Guardian locks are unaffected by a
fcntl() call.
fcntl() can be called from a native OSS process or a TNS Guardian process.
Using the link() Function
The link() function call is not supported for linking across OSS filesets or for OSS
directories. Links to Guardian files, to /dev/tty, to /dev/null, or to the directory
called lost+found in the root directory of an OSS fileset are not allowed.
Using the lseek() Function
You cannot use the lseek() function call with pipes, FIFO files, character special
files, or other devices. Seeks are not allowed on Guardian EDIT files, unless the
offset parameter is 0 (zero) and the whence parameter is set to SEEK_SET;
otherwise, an error is returned.