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
Native Migration Overview
Open System Services Porting Guide—520573-006
10-8
Changes to the exit() Function
Changes to the exit() Function
Check the use of the changed C library exit() standard function. In the TNS
Guardian environment, a nonzero status parameter value from exit() indicates
abnormal termination. In the native Guardian environment, any status parameter
value indicates normal termination. The function call to the Guardian
terminate_program() function must be changed to use the status parameter to
indicate abnormal termination, if it does not already do so.
Changes to the Scanset
Check the use of the changed C library fscanf(), scanf(), and sscanf()
standard functions. In the TNS Guardian environment, using the hyphen character (-)
in a scanset in the fscanf(), scanf(), and sscanf() functions denotes the
hyphen character. In the native Guardian environment, the hyphen character denotes a
range of characters. A backslash character (\) must be inserted before the hyphen
character in the scanset to maintain the TNS Guardian environment behavior.
Checking the Condition Code
Native C programs require a change in the manner in which the condition code
(_cc_status) returned by a Guardian procedure call is checked. In TNS programs,
the condition code is checked as follows:
_cc_status CC;
...
CC = WRITEX( ... );
if ( CC == CCG)
In native programs, the equivalent code is:
CC = WRITEX( ... );
if ( _status_gt(CC))
By using the tal.h header file for native programs, the above equivalent code can be
used for TNS and accelerated programs. In the same manner, _status_eq would be
used instead of CCE, and _status_lt would be used instead of CCL.
Signal Mask Width
The D3x RVUS support about 30 different signals using a user-visible signal mask
(type sigset_t) of 32 bits; the current D4x, G-series, and H-series RVUs support
fewer than 32 signals and the user-visible signal mask (type sigset_t) for native
processes is 128 bits. This difference affects all of the signal-handling routines and
signal structures. The tdm_spawn() function and PROCESS_SPAWN_ procedure
and their inheritance structures are also affected.