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
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide—520573-006
8-14
Using OSS Functions in a Guardian Program
management procedures with OSS processes are shown in the Open System Services
Programmer’s Guide.
Using OSS Functions in a Guardian Program
A Guardian program written in C normally uses Guardian procedure calls (documented
in the Guardian Procedure Calls Reference Manual) and run-time routines from the
Guardian C run-time library (documented in the Guardian TNS C Library Calls
Reference Manual or the Guardian Native C Library Calls Reference Manual). To add
open features to a Guardian program, the program can make use of OSS function calls
(documented in the Open System Services System Calls Reference Manual and Open
System Services Library Calls Reference Manual).
This subsection discusses the criteria that determine which OSS functions can be used
in a Guardian program and how to use these functions.
The various C functions that are linked into a program have operational characteristics
that depend on the target environment (OSS or Guardian) and the subset of the
language being used. The normal behavior for a function in a given environment is to
operate within a process of that environment and on objects within that environment.
Many functions (such as mathematics and memory functions) behave the same,
regardless of the environment. However, some functions can operate within processes
of the opposite environment, or on objects of the opposite environment, to some
extent.
Interoperability, as it relates to the use of functions, is defined as the use of a function
that normally operates in the opposite environment process, the use of a function on
an object which lives in the opposite environment, or mixing the use of both
personalities inside the same program.
The criteria that affect API usage are described in the following subsections:
•
Memory Model to Be Used on page 8-14
•
Process Target Type on page 8-15
•
Use of Environment-Specific Functions on page 8-15
•
Object Type Being Manipulated on page 8-16
•
Language or C Environment Type on page 8-16
•
API Interoperability on page 8-17
•
Side Effects on page 8-17
Memory Model to Be Used
The C language supports three models (small, large, wide), varying in the width of an
integer, in the width of a pointer, and in various combinations thereof. OSS functions
support only the wide model (int is 32 bits, pointer size is 32 bits). Thus, the use of
OSS routines is confined to Guardian programs that use the wide model, which is true
for both C and TAL programs.