Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 24
Creating a Named Process
The following example supplies a process name:
#include <dlaunch.h>
#include "$system.zsysdefs.zsysc(zsys_ddl_smsg_proccreate, \
process_constant)"
#include <cextdecs(PROCESS_LAUNCH_)>
.
.
process_launch_parms_def paramList = P_L_DEFAULT_PARMS_;
zsys_ddl_smsg_proccreate_def outputList;
short error, errorDetail, outputListLen;
.
.
paramList.program_name = "PROGFILE";
paramList.program_name_len = sizeof("PROGFILE") - 1;
paramList.name_options = ZSYS_VAL_PCREATOPT_NAMEINCALL;
paramList.process_name = "$REQ";
paramList.process_name_len = sizeof("$REQ") - 1;
error = PROCESS_LAUNCH_( &paramList,
&errorDetail,
&outputList, sizeof(outputList),
&outputListLen);
Here, the information returned in the outputList structure includes the named form of a
process descriptor. See Section 2, Using the File System, for a discussion of process
names and process descriptors.
Requesting a System-Generated Process Name
Use either of the following operations to make the system provide a name for your
process:
Use the PROCESSNAME_CREATE_ procedure to create the name. You can
pass the name to the PROCESS_LAUNCH_ procedure the same way you would a
user-specified name.
Call the PROCESS_LAUNCH_ procedure with the NAME_OPTIONS field of the
input parameter structure set to the value of the
ZSYS^VAL^PCREATOPT^NAMEDBYSYS literal.
If you need the system to create a process name before you create the corresponding
process, or if you need the system to create a remote long name (5 characters plus the
$ sign), then you must use the PROCESSNAME_CREATE_ procedure. Otherwise,
you can use PROCESS_LAUNCH_ with the NAME_OPTIONS field of the input
parameter structure set for a system-generated name. Each of these methods is
described in the following paragraphs.
Using the PROCESSNAME_CREATE_ Procedure
The PROCESSNAME_CREATE_ procedure gives you the option of returning a
6-character process name or a 5-character process name, and you have the option of
adding a node name. You use the name-type parameter to request the length of the