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
Porting From Specific UNIX Systems
Open System Services Porting Guide—520573-006
9-6
Development Tools
Standard and Alternate Library Directories
Libraries on a UNIX workstation are usually kept in the /usr/lib and /lib
directories. The OSS file system provides the same directory structure, so that ported
applications can keep their libraries in the same locations.
You should check the location and content of libraries on the system you are porting
from and on the system you are porting to. If your UNIX system does not keep its
libraries in /usr/lib and /lib, or if it uses other implementation-defined library
directories, you might need to compensate when you link a ported program in the OSS
environment.
To look for a library routine on your workstation, check /usr/lib, then /lib, then
alternate library directories. If your workstation compiler is ISO/ANSI compliant, it
should have a -L flag. The -L flag can be used to search for your own versions of the
library routines. The HP C compiler supports the -L flag.
The object modules in the OSS versions of the standard C library include the system
calls and the standard run-time routines provided by many UNIX systems. The
standard C library is searched by default when the C compiler invokes the nld, ld, or
eld linker to build an executable program; when you invoke nld, ld, or eld directly,
you must explicitly specify the standard C library.
Implementor-Defined Values
Part of an application program environment depends on the vendor’s interpretation of
standards and specifications. Such interpretations exist when a value must be
determined by the system architecture or when the standards body could not agree on
a single behavior for a feature of a function or command.
Programs that push the limits of a system can exhibit behavior differences when ported
to another platform. For example, if you have a C program that is dependent on the
number of digits in the mantissa of a long double-precision floating-point value
(LDBL_MANT_DIG), you need to consider the following implementation differences:
Locate header files such as limits.h and float.h on the system you are porting
from and the system you are porting to. (For the OSS environment, selected values
can be found in the float(4) and limits(4) reference pages either online or in
the Open System Services System Calls Reference Manual.) Compare the values
defined for any critical implementation-defined symbols.
Execution Environment C Compiler Flag or Macro Bits in Mantissa
HP Tru64 UNIX
® __IEEE_FLOAT 113
HP OpenVMS __IEEE_FLOAT 113
IBM AIX __LONGDOUBLE128 106
Open System Services -WIEEE_float 53
Sun Solaris 7 on SPARC 113
Sun Solaris 7 on Intel x86 64