Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
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, H-series, and J-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.
Memory Attributes
Native processes have different stack and heap sizes than TNS interpreted processes and TNS
accelerated processes. Three attributes in the process_extension_def input structure used by
the tdm_fork() function and the tdm_execve and tdm_spawn sets of functions allow control
over this difference:
pe_heap_max for maximum heap sizeint
pe_mainstack_max for maximum main stack sizeint
pe_space_guarantee, swap file reserved by KMSFint
Using Common Run-Time Environment (CRE) Functions
OSS TNS programs that use obsolete or changed Common Run-Time Environment (CRE) functions
must be modified to run as native programs in the native environment.
The default CRE trap handler must be replaced with the default signal handler. There are changes
in the arithmetic overflow and checking behavior of CRE_ and RTL_ arithmetic functions. Obsolete
CRE_ and RTL_ functions should be replaced by ISO/ANSI C library functions, when possible.
The native atof() and strtod() functions differ from the older TNS versions of the functions
to conform to XPG4.
Refer to the Common Run-Time Environment (CRE) Programmer’s Guide for more details on the
CRE functions for native programs.
Guardian Procedure Features
A number of Guardian procedures have specific features to support native-mode processes. The
PROCESS_LAUNCH_ Guardian procedure call supersedes the PROCESS_CREATE_ Guardian
procedure call. PROCESS_LAUNCH_ handles a larger number of input parameters in a more
flexible manner; it includes:
• All of the input parameters specified by PROCESS_CREATE_.
• The parameters supported by tdm_fork(), the tdm_execve set of functions, and the
tdm_spawn set of functions to set the maximum heap size and main stack size for a new
process and to support KMSF. These parameters are discussed earlier in “Memory Attributes”
(page 176).
The PROCESS_CREATE_ procedure call can be used in the native environment if no new process
attributes need setting. For native processes, the swap-file, ext-swap-file, and
memory-pages parameters of PROCESS_CREATE_ are not needed.
The PROCESS_GETINFOLIST_ procedure call returns the process attributes defined for native
processes. The PROCESS_SETINFO_ procedure call can be used to change the maximum main
stack size, which is different for native processes.
176 Native Migration Overview