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-3
CodeCheck Tool
findcalls performs a simple but fast lexical analysis of your C source code by
searching for occurrences of system calls. By using the UNIX comm utility to compare
the list of system calls used by the application with the list provided in the OSS
environment, you can approximate the task of porting the application to the OSS
environment. (A shell script for the UNIX comm tasks is provided with findcalls.)
findcalls seeks occurrences of a known list of functions by using a list you provide
when starting findcalls. The default list supplied by HP contains all the functions
whose names appear in reference pages for SunOS, OSF/1, and UNIX System V
Release 4 (SVR4). Each time findcalls finds a function call, it checks whether the
function name is present in the provided list of OSS function calls. If it finds the call,
findcalls writes the name to a file whose name ends in “.is_in_list.” If it does
not find the call, findcalls writes the name to a file whose name ends in
“.not_in_list.”
The findcalls distribution includes a helpful README file explaining the use of the
tool in detail. Within the README file, there is a tutorial that directs you through an
example of using findcalls.
CodeCheck Tool
CodeCheck is a programming tool developed by ABRAXAS Software, Inc. for the UNIX
workstation. It examines source C and C++ code for compliance with POSIX.1 and
POSIX.2 standards. It reviews code and locates which parts are not portable (not
standards-compliant). When it encounters a noncompliant line of code, CodeCheck
flags it and offers suggestions on how to correct it.
CodeCheck uses rule files to check for invalid or faulty coding techniques. For
example, there are rules that check for ISO/ANSI C compatibility, for portability
(specific vendor machines, or in general), and for maintainability. Further, there are rule
files that check for good programming techniques and format: consistent braces,
proper indentation, and ordering of file elements.
You make your checking selections from the optional parameters and the library of rule
profiles. CodeCheck’s options are available at the command line. You can do the
following:
•
Show progress of code checking
•
Identify the dialect of C to be assumed for the source files, such as Common C,
ISO/ANSI C, or C++
•
Define macros and list macro expansions
•
Count tokens, lines, operators, and operands
•
Create prototypes for all functions defined in a project
•
Enable embedded SQL statements
CodeCheck works with many variations of C and C++ source code, including source
code for HP, Microsoft, Borland, Microtec, Green Hills, MetaWare, Watcom, AT&T,