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

Table Of Contents
Native Migration Overview
Open System Services Porting Guide520573-006
10-9
Memory Attributes
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:
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
on page 10-9.
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.
Some Guardian procedure calls have been replaced in the native environment:
int pe_heap_max for maximum heap size
int pe_mainstack_max for maximum main stack size
int pe_space_guarantee, swap file reserved by KMSF