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-20
Directory Operations
Performance Considerations for Files
Because these OSS file operations consume more resources than the same
operations on other UNIX systems, note these recommendations:
•
Avoid performing numerous opens and closes of files and performing numerous
short reads and writes.
•
Consolidate operations when possible.
•
Avoid working with a great number of small files. (You will use the same amount of
resources to open a small file as a large file.)
•
The size of the data transfer on the OSS read() and write() function calls is
limited to 52 kilobytes.
If your UNIX program opens and closes a lot of files or executes a lot of scripts (which
usually contain a lot of commands, each possibly requiring a process creation), you will
have to solve a performance issue. As a result, you should redesign your program to
be less dependent on open and close file operations.
Directory Operations
A directory is a file which contains filename entries. In the OSS environment, directory
operations are similar to file operations. Directory I/O operations using the OSS
opendir() and readdir() function calls are buffered and cached. The opendir()
function opens the specified directory and associates it to a directory stream. A
directory stream acts as a handle to access the contents of a directory. The directory
stream attributes are inherited by the child process when using the fork() or
tdm_fork() function, but not when using the exec, tdm_exec, or tdm_spawn set of
functions.
However, the overhead on an OSS system tends to be higher than on some UNIX
systems because additional system processes are involved in the execution of these
function calls. See Performance Considerations for Files on page 6-20 for guidelines
on improving system performance.
Caching Considerations
A cache is a high-speed buffer storage that is continually updated to contain recently
accessed contents of a disk. Caching improves performance by reducing disk access
time in UNIX and OSS environments. Caching is standard to and used throughout the
UNIX system: for example, file and directory caching.
There are two types of file caching supported in the OSS environment: OSS name
server caching and data block caching. OSS name server caching improves file open
performance. Data block caching improves file I/O and disk I/O performance.