Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 57
Getting Process Information
In the example above, RETURN^ATTRIBUTE^LIST contains a list of integer values
that specify the information you want returned. The procedure returns the information
in one array: RETURN^VALUES^LIST. The attribute values are returned in the order
in which they were requested in RETURN^ATTRIBUTES^LIST.
The attribute values returned by PROCESS_GETINFOLIST_ can be of any valid data
type. For variable-length strings (such as the home terminal name), the procedure first
returns the number of bytes in the string, then the string itself. See the Guardian
Procedure Calls Reference Manual for a discussion of all possible attributes and their
data types.
Getting List Information About Multiple Processes
You can retrieve information about multiple processes from the
PROCESS_GETINFOLIST_ procedure by supplying the procedure with search criteria
information. You might, for example, want to retrieve information about all processes
of a given priority, all processes with a specified creator access ID, or all processes
started from a specified terminal.
The following example returns information about all processes with the same process
access ID as the current process. The example uses the PROCESS_GETINFO_
procedure to determine the current process access ID and then supplies this value as
the search criterion for the PROCESS_GETINFOLIST_ procedure.
CALL PROCESS_GETINFO_(!process^handle!,
!file^name:maxlen!,
!file^name^len!,
!priority!,
!moms^processhandle!,
!hometerm:maxlen!,
!hometerm^len!,
!process^time!,
!creator^access^id!,
PROCESS^ACCESS^ID);
PIN := 255;
RETURN^ATTRIBUTE^LIST ':=' (CREATOR^ACCESS^ID^ATTR
PROCESS^ACCESS^ID^ATTR,
HOME^TERM^NAME^ATTR,
PROCESS^SUBTYPE^ATTR,
PROCESS^TIME^ATTR,
PROCESS^STATE^ATTR);
RETURN^ATTRIBUTE^COUNT := 6;
RETURN^VALUES^MAXLEN := 2048;
SEARCH^OPTION = 2;
SEARCH^ATTRIBUTE^LIST := PROCESS^ACCESS^ID^ATTR;
SEARCH^ATTRIBUTE^COUNT := 1;
SEARCH^VALUES^LIST := PROCESS^ACCESS^ID;
SEARCH^VALUES^LEN := 1;