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-21
Using OSS Function Calls
Using the lstat(), readlink(), and symlink() Functions
You cannot use the lstat(), readlink(), or symlink() functions to set symbolic
links in the Guardian file system. However, Guardian files can be pointed to by
symbolic links created in the OSS file system.
Using the mkdir() Function
You are allowed to use the mkdir() function call in the OSS file system as long as
you do not set any bits in the mode parameter other than the file permission bits,
S_ISVTX, and S_IFDIR. The group ID is set to the group ID of the parent directory if
the S_ISGID parameter is set in the parent directory; otherwise, the group ID is set to
the effective group ID of the calling process. mkdir() cannot be used to create a
directory named /dev, /dev/null, /dev/tty, or /lost+found in the root directory
of an OSS fileset.
When you use mkdir() for directories within the Guardian file system, the owner ID is
set to 65535 (the group ID is set to 255), and the permission bits are set to
“rwxrwxrwx.” Only Guardian subvolumes can be created within the Guardian file
system; mkdir() cannot create a Guardian node, volume, or file.
Using the mknod() Function
The mknod() function can be used to create a new OSS file that is a FIFO, character-
special, directory, or regular file. If the file type is S_IFCHR (character-special), the
following values are defined for the device parameter:
•
00000003xxxxxxxx, infinite data source and data sink, such as /dev/null,
where the device number specified by xxxxxxxx is unique within the program.
•
00000002xxxxxxxx, a synonym for a controlling terminal, such as /dev/tty,
where the device number specified by xxxxxxxx is unique within the program.
In the Guardian file system (/G), only regular files (within subvolume directories) and
directories at the subvolume level can be created. The file protection parameters
S_ISUID, S_ISGID, and S_ISVTX are ignored, as they are for all files created in /G.
Using the mkfifo() Function
You cannot use the mkfifo() function to create FIFOs in the Guardian file system.
Using the open() Function
The open() function call can be used to open and create files in the Guardian file
system. Only odd-unstructured, EDIT, or tty-simulation process files can be opened.
Attempts to open other Guardian files fail. Regular Guardian files are opened in
shared-exclusion mode; EDIT files are opened in protected-exclusion mode.
Files created in the Guardian file system are created as odd-unstructured, with a file
code of 180 and access permissions of “rwxr-xr-x.” During open() or creat()
function processing, all access permissions are checked. Checks are performed by