Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 60
Setting Process Information
Using the PROCESSHANDLE_GETMINE_ Procedure
A process can retrieve its own process handle by calling the
PROCESSHANDLE_GETMINE_ procedure. While you can achieve the same result
by passing a null process handle to the PROCESS_GETINFO_ procedure,
PROCESSHANDLE_GETMINE_ performs this task more efficiently and without the
need to initialize the process handle:
INT .MYPHANDLE[0:ZSYS^VAL^PHANDLE^WLEN - 1];
.
.
ERROR := PROCESSHANDLE_GETMINE_(MYPHANDLE);
Setting Process Information
In addition to setting attribute values when creating a process, you can change the
attribute values of existing processes using either the PROCESS_SETINFO_ or
PROCESS_SETSTRINGINFO_ procedures. This subsection shows some examples
of how to use these procedures. See the Guardian Procedure Calls Reference Manual
for complete details on these procedure calls.
Setting Nonstring Process Attributes
To change a nonstring attribute of an existing process, use the PROCESS_SETINFO_
procedure. This procedure allows you to change the following attributes and optionally
return the old value:
Process priority.
The process handle in the mom field in the PCB. Changing this value causes the
Process deletion message (system message -101) to be sent to the new mom
when the process terminates. This feature is useful only for unnamed process
pairs.
The process file security for the process. This value determines the security used
for any file-creation attempt by the process following the call to
PROCESS_SETINFO_. You can use this option only on your own process.
The primary attribute, which indicates whether the process is the primary or
backup of a process pair. You can set this value only for the calling process.
The qualifier-info-available attribute, which determines whether qualifier-
name searches by the FILENAME_FIND_ procedure are valid. You can set this
value only for the calling process. See Section 13, Manipulating File Names, for
information about the FILENAME_FIND_ procedure.
To change the mom entry in the PCB or the priority of a process, your process must
have either the same process access ID as the process you want to change, the group
managers process access ID, or the process access ID of the super ID user. The
remaining attributes can be changed only in the current process.