Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 54
Getting Process Information
The process handle
The process descriptor
Information about related processes, such as the process handle of the job
ancestor, the job ID, and the process handle of the mom process
The name and length of the program file
The name and length of the swap file
The execution priority
Process timing information (see Section 18, Managing Time)
PROCESS_GETINFOLIST_ provides lists of more detailed information about a specific
process or about a list of processes that satisfy specified search criteria.
PROCESS_GETPAIRINFO_ provides information about a named process or process
pair, including:
The process handles of the primary and backup processes
The process handle of the ancestor process
The name of a process identified by process handle
Lists of process names identified by a search string
PROCESSHANDLE_GETMINE_ provides an efficient way of obtaining the process
handle of the calling process.
Using the PROCESS_GETINFO_ Procedure
Some examples of common uses of the PROCESS_GETINFO_ procedure follow. The
first example returns the home terminal name for the process. The returned name is
suitable for supplying to the FILE_OPEN_ procedure to open the terminal:
STRING HOME^TERM[0:ZSYS^VAL^LEN^FILENAME - 1]
.
.
ERROR := PROCESS_GETINFO_(!process^handle!,
!file^name:maxlen!,
!file^name^len!,
!priority!,
!moms^processhandle!,
HOME^TERM:ZSYS^VAL^LEN^FILENAME,
HOME^TERM^LENGTH);
IF ERROR <> 0 THEN ...
.
.
ERROR := FILE_OPEN_(HOME^TERM:HOME^TERM^LENGTH,F^NUM);
IF ERROR <> 0 THEN ...