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-30
Use of Common Run-Time Environment (CRE)
Functions
functions specified by the XPG4 specifications. It also provides HP extensions for input
and output, memory management, string manipulation, and fault-tolerant programming.
All ISO/ANSI C functions are available in both environments. Some of the XPG4
functions and HP extension functions are available only in one environment. Refer to
the API interoperability tables in the Open System Services Programmer’s Guide to
determine which functions are available from the OSS environment. If a Guardian
program uses a Guardian C run-time routine that is available only in the Guardian
environment, the routine needs to be replaced by an OSS routine with equivalent
behavior. The complete semantics and syntax of the Guardian C run-time routines are
described in the Guardian Native C Library Calls Reference Manual. For OSS C run-
time routines, refer to the Open System Services Library Calls Reference Manual.
When a program is migrated from the Guardian environment to the OSS environment,
many of the C run-time routines used in the program can be used as is. The
exceptions are those that are specific to the Guardian environment and those which
have the same name in both environments but use different arguments in the two
environments. All calls to run-time routines that use a Guardian filename argument
need to be modified to use the OSS version of the run-time routines which use an OSS
pathname argument.
In cases where the Guardian routines have no equivalents in the OSS environment,
you have two options. The first is to compile the module containing the Guardian C
run-time routine as a Guardian module; the second is to replace the module with an
equivalent module. The second option will make the program more portable to other
open systems environments. You should refer to the C/C++ Programmer’s Guide for
more details on which C run-time routines work in which environment. The API
interoperability tables in the Open System Services Programmer’s Guide also provide
an overview of how and where each C run-time routine can be used.
In addition to the OSS C run-time routines, the XPG4 system calls, and most Guardian
procedure calls that can be used in an OSS program, some HP process-creation
functions can also be used in a program that is being migrated from the Guardian
environment to the OSS environment. These include tdm_fork() and the
tdm_execve set of functions that can be used to create OSS processes with specific
Guardian attributes such as process name, processor number, process priority, and
home terminal. The tdm_spawn set of functions can be used to run an OSS program
with specific Guardian attributes in one automatic operation. These HP functions
provide more interoperability between the Guardian and OSS environments.
Use of Common Run-Time Environment (CRE) Functions
The Common Run-Time Environment (CRE) library functions provide a common set of
services to programs in both the OSS and Guardian environments. They can be used
with the following restrictions in the OSS environment:
•
File sharing functions cannot be used.
•
CRE mathematical functions do not trap if an invalid parameter is passed, but they
do set the errno variable.