Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 61
Manipulating Process Identifiers
For example, the following call to PROCESS_SETINFO_ sets the
qualifier-info-available attribute:
LITERAL QUALIFIER^INFO^AVAILABLE = 49;
.
.
SET^ATTRIBUTE^CODE := QUALIFIER^INFO^AVAILABLE;
SET^VALUE := 1;
SET^VALUE^LEN := 1;
CALL PROCESS_SETINFO_(!process^handle!,
!specifier!,
SET^ATTRIBUTE^CODE,
SET^VALUE,
SET^VALUE^LEN);
The set-attr-code parameter specifies the attribute to set; the set-value
parameter specifies the new value of the attribute.
Setting String Process Attributes
To set process attributes that are strings, you use the PROCESS_SETSTRINGINFO_
procedure. The only attribute that is currently settable using this procedure is the
home terminal name.
To set the home terminal name of a process, you supply the
PROCESS_SETSTRINGINFO_ procedure with the process handle of the process
whose home terminal you wish to change, the attribute code (5 for the home terminal),
the new terminal name, and the name length. You can use the
ZSYS^VAL^PINF^HOMETERM literal from the ZSYSTAL file to specify the attribute
code.
The following example sets the home terminal for the current process to $TERM1.
Note that for the current process, it is not necessary to provide the process handle.
SET^ATTRIBUTE^CODE := ZSYS^VAL^PINF^HOMETERM;
SET^ATTRIBUTE^VALUE ':=' "$TERM1" -> @S^PTR;
VALUE^LENGTH := @S^PTR '-' @SET^ATTRIBUTE^VALUE;
CALL PROCESS_SETSTRINGINFO_(
!process^handle!,
!specifier!,
SET^ATTRIBUTE^CODE,
SET^ATTRIBUTE^VALUE:VALUE^LENGTH);
To change the home terminal 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.
Manipulating Process Identifiers
This subsection describes system procedures that manipulate process handles. It
discusses how to use the PROCESSHANDLE_DECOMPOSE_ procedure to retrieve
information from a process handle as well as how to use the