Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 58
Getting Process Information
ERROR := PROCESS_GETINFOLIST_(!cpu!,
PIN,
!nodename:length!,
!process^handle!,
RETURN^ATTRIBUTE^LIST,
RETURN^ATTRIBUTE^COUNT,
RETURN^VALUES^LIST,
RETURN^VALUES^MAXLEN,
RETURN^VALUES^LEN,
ERROR^DETAIL,
SEARCH^OPTION,
SEARCH^ATTRIBUTE^LIST,
SEARCH^ATTRIBUTE^COUNT,
SEARCH^VALUES^LIST,
SEARCH^VALUES^LEN);
The search-option parameter, when set to 2, causes the procedure to search all
processes with a PIN greater than or equal to the PIN specified in the pin parameter.
In this example, the search is therefore restricted to all processes running at a high PIN
(256 or greater).
Information for all processes identified in the search is returned in the
ret-values-list parameter. If the information for the first matched process
occupies n words, then information for the second process starts at
ret-values-list[n].
Using the PROCESS_GETPAIRINFO_ Procedure
Some examples of typical uses of the PROCESS_GETPAIRINFO_ procedure follow.
The first example returns the process handle and name of the ancestor process of the
calling process:
INT ANCESTOR^PROCESS^HANDLE[0:ZSYS^VAL^PHANDLE^WLEN - 1];
ANC^MAXLEN := ZSYS^VAL^LEN^FILENAME;
ERROR := PROCESS_GETPAIRINFO_(!process^handle!,
!pair:maxlen!,
!pair^length!,
!primary^processhandle!,
!backup^processhandle!,
!search^index!,
ANCESTOR^PROCESS^HANDLE,
!nodename:length!,
!options!,
ANCESTOR^NAME:ANC^MAXLEN,
ANCESTOR^NAMELEN);
The next example uses the search index to find all processes on the node \CENTRAL.
The setting of the options parameter includes I/O processes in the list.
MAXLEN := ZSYS^VAL^LEN^FILENAME^D00;
SEARCH^INDEX := 0D;
NODE^NAME ':=' "\CENTRAL" -> @S^PTR;
NODENAME^LENGTH := @S^PTR '-' @NODE^NAME;