Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Native Migration Overview
Open System Services Porting Guide520573-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.