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 Programming Environments
Open System Services Porting Guide—520573-006
5-4
Function Entry Points Defined in Header Files
Function Entry Points Defined in Header Files
In the Guardian environment, header files are in $SYSTEM.SYSTEM by default. In the
OSS environment, header files are in /usr/include and its subdirectories by
default. For TNS processing environments, these files support three different memory
models in the Guardian environment and the WIDE data model in the OSS
environment. For native processing environments, the Guardian environment and the
OSS environment both use the WIDE data model.
For TNS processing environments, the proper entry point to the system is determined
by compiler-defined symbols. In general, you do not need to be concerned with the
details of how the proper entry point is selected in the header files. Selection involves
the use of the appropriate pragmas in the source code or symbol definitions in the
compiler command line. Reasonable defaults are used in each of the environments.
Role of the cextdecs.h File for Accessing Guardian Procedures
C programs can access Guardian system procedures by including sections from the
header file cextdecs.h file in the OSS environment. The cextdecs.h file contains
function prototype declarations for the system procedures you can call directly from
your C program.
cextdecs.h specifies the C names for the system procedures with uppercase
characters, and provides a section for each procedure using the SECTION pragma. It
declares system procedures that return condition codes as TAL procedures returning
_cc_status. Consequently, you must include the header tal.h before you call such
a system procedure. See Checking the Condition Code on page 10-8 for using
condition codes in the TNS/R and TNS/E native environments.
To access the declarations in cextdecs.h, use the #include directive, specifying
the names of the system procedures you want to include as section names. The
following example includes the declarations of the PROCESS_GETINFOLIST_ and
FILENAME_FINDNEXT_ Guardian procedures:
#include <cextdecs.h(PROCESS_GETINFOLIST_,FILENAME_FINDNEXT_)>
The syntax of a system procedure call determines whether a parameter is required or
is optional. To call system procedures with optional parameters, you can omit the
parameter, but must include the comma that would follow it. For example:
ERR = FILENAME_SCAN_ (string,length,count,,,options);
API Interoperability
Interoperability of the Guardian and OSS environments on the same system refers to:
•
The ability of a program to utilize the API of either environment
•
The ability of one API to access or manipulate objects of the other environment
•
The ability of utilities to access or manipulate objects of the other environment