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
Useful Porting Tools
Open System Services Porting Guide—520573-006
3-2
findcalls Tool
compilers. Refer to the C/C++ Programmer’s Guide for more information on using the
HP C compiler.
The lint tool detects wasteful or error-prone constructions, which in some cases are
actually valid coding practices. By default, lint checks your programs against a
standard library file that contains descriptions of the programs normally loaded when a
C program is run. You have the option of suppressing various checking operations, as
well as generating various types of messages printed by lint.
In addition to these checks, lint checks for the following programming faults:
•
Defined but unused variables and functions
•
Variables used before they are set
•
Functions that return unused values
•
Flow control: unreachable program portions, unlabeled statements, and
endless loops
•
Strict type-checking: enumeration, function use, operator selection, and implied
assignments
•
Nonportable character use, such as incompatible character ranges
The most important messages lint returns involve the matching of the number and
type of formal and actual parameters to functions, the matching of the type of return
expressions and return values of functions, and the use of return values from functions.
A frequent programming error occurs when you fail to declare external functions. The
C programming language operates as if, unless declared, every function returns an
int type. A problem can arise when a function returns a char* type. The lint tool
detects this type-mismatch problem. (In environments where int and char* are the
same size, the ported code will work, but only sometimes. However, this type-
mismatch will cause problems on machines where int is 16 bits and char* is 32
bits.)
findcalls Tool
findcalls is a programming tool developed by HP to help port applications to an
Open System Services (OSS) environment. findcalls is a source code analyzer
written in the Perl programming language. To use findcalls, you must have Perl
installed on a UNIX workstation. findcalls does not run on NonStop systems, and it
is available only through your service provider.
When porting a large UNIX application from one platform to another, determine in
advance which system calls are used by the application. No two implementations of
the UNIX operating system are exactly alike. Even those that conform to open
standards such as IEEE POSIX or X/Open XPG often supply proprietary extensions
beyond the standards. Even if two platforms share 95 percent of the system calls used
by an application, you must deal with the other 5 percent.