Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 17
Controlling Process Creation
The following code fragment checks a flag value to see whether remote password
changes are allowed, then returns display text to the TACL process, depending on the
setting of the flag:
CALL READUPDATEX(RECV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF BUFFER[0] = -58 THEN
BEGIN
IF CHANGE^REMOTE^PASSWORD = YES THEN
BEGIN
REMOTEPASSWORD^REPLY.REPLYCODE := 0;
REMOTEPASSWORD^REPLY.REPLYTEXT ':='
["Password change approved",0];
END
ELSE
BEGIN
REMOTEPASSWORD^REPLY.REPLYCODE := 1;
REMOTEPASSWORD^REPLY.REPLYTEXT ':='
["Password change rejected",0];
END;
SCAN REMOTEPASSWORD^REPLY.REPLYTEXT[0] UNTIL 0 -> @LAST;
REPLY^LEN := 2 + @LAST - @REMOTEPASSWORD^REPLY.REPLYTEXT;
CALL REPLYX(REMOTEPASSWORD^REPLY,REPLY^LEN);
END;
Controlling Process Creation
When a user attempts to create a new process explicitly by issuing a RUN command,
implicitly by typing an object-file name, or by using the #NEWPROCESS built-in
function, the TACL process sends a Processcreation^msg message to the $CMON
process to request verification of the process. The $CMON process may reject the
request, or it may accept the request but optionally perform the following controls:
Change the CPU in which the new process will execute
Change the priority of the new process
Change the program-file name from what was requested by the user