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 User Environments
Open System Services Porting Guide—520573-006
4-24
Manipulating Guardian Files From the OSS Shell
The OSS file system is responsible for enabling the transparent read access of EDIT
files for all programs executing in the OSS environment. Thus, all the standard OSS
utilities—such as cat, more, and grep, and programs that you write—are able to
access EDIT files (type 101) and odd-unstructured files (types 0, 100, and 180). EDIT
files can be read and, by using OSSTTY, they can also be written; odd-unstructured
files can be read and written.
The following example command displays the file $SYSTEM.ZTCPIP.HOSTS:
more /G/system/ztcpip/hosts
The following example command searches for the string ftp in the file
$SYSTEM.ZTCPIP.SERVICES:
grep ftp /G/system/ztcpip/services
The chgrp and chown Utilities
Use the chgrp utility to change the group ownership of a file or directory; use the
chown utility to change the owner of a file or directory.
The Guardian security rules and restrictions apply when an attempt is made to change
the group or user ownership of a file in the /G directory or in a Guardian file system
portion of the /E directory. Group or user ownership of a file can normally be given to a
group or user only by a user with the 65535 super ID. Refer to the Guardian User’s
Guide for more information on the Guardian file security features.
The chmod Utility
Use the chmod utility to change permission codes on only OSS files. Access
permissions on a Guardian file cannot be set using chmod. After a file is created in the
/G file system, you cannot change its permissions with chmod.
The cp Utility
You can use the OSS cp utility to copy files in the OSS environment, within the portion
of the Guardian file system accessible through the /G directory, or between different
file systems. By copying files within /G, you obtain the same results as using the
Guardian procedure FUP DUP. A complete binary copy is made, preserving all
attributes.
The following example copies a file within /G and creates another file in /G:
cp /G/data01/stu01/report /G/data01/stu01/reprtold
cp copies ASCII text files (type 180) and untyped files (type 0) from the Guardian
environment to the OSS environment without conversion. EDIT files (type 101) are
converted to ASCII text files. Attempts to copy any other type of file return an error.
The cp utility converts (and truncates, if necessary) OSS pathnames to compatible
Guardian filenames.