Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 33
Specifying Process Attributes and Resources
34, or a DEFINE error 2052, then you need extra PFS space for your program to run.
You can create a PFS of up to one megabyte.
If you need to reduce the amount of virtual memory used by your process, you might
be able to reduce the PFS size to a minimum of 128 KB.
You can use a linker (either the Binder or the nld utility) to specify the size of the PFS.
(See the Binder Manual or the nld and noft Manual). The value set by the linker
becomes the default value for your process. To create a different-sized PFS in your
program, you must specify the PFS size in bytes. This value must change the PFS
size to something between one and eight unitary segments (131,072 to 1,048,576
bytes).
The following example sets the process file segment size to 524,288 bytes:
.
.
PARAM_LIST.PFS_SIZE := 524288D;
ERROR := PROCESS_LAUNCH_( PARAM_LIST,
ERROR_DETAIL,
OUTPUT_LIST:$LEN(OUTPUT_LIST),
OUTPUT_LIST_LEN);
Specifying a User Library File
Use the LIBRARY_NAME and LIBRARY_NAME_LEN fields of the input parameter
structure of the PROCESS_LAUNCH_ procedure to specify a procedure library. This
library is a second object file containing user-written procedures called from the
program file. When a TNS process is created, the library file occupies the user library
space (UL). When a native process is created, the library file occupies the native UL
space.
The following example uses a library file named PROCLIB:
.
.
LIB_NAME ':=' "PROCLIB" -> @S^PTR;
@PARAM_LIST.LIBRARY_NAME := $XADR(LIB_NAME);
PARAM_LIST.LIBRARY_NAME_LEN := $DBL(@S^PTR '-' @LIB_NAME);
ERROR := PROCESS_LAUNCH_( PARAM_LIST,
ERROR_DETAIL,
OUTPUT_LIST:$LEN(OUTPUT_LIST),
OUTPUT_LIST_LEN);
Specifying Swap Files
In a large majority of cases, it is unnecessary to specify a swap file for a new process,
whether by supplying a value in the SWAPFILE_NAME field or in the
EXTSWAPFILE_NAME field of the input parameter structure. In general, you should
simply allow the system to manage swap space.
For all processes, values supplied in the SWAPFILE_NAME and
SWAPFILE_NAME_LEN fields of the input parameter structure of the