Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 26
Receiving and Processing System Messages
Receiving and Processing System Messages
Recall that in addition to receiving messages from other processes, a process may
receive system messages from the operating system on the $RECEIVE file.
Of the many system messages that the operating system can send, the writer of an
application usually need be aware of only a subset. Of the system messages that a
process typically processes, some are implicit and others are explicit. Implicit system
messages indicate that some condition has occurred that may affect this process, such
as the death of a process that was created by this process.
Explicit system messages result from an operation performed by another process on
the process file, such as opening the file or performing a SETMODE function. This
subsection discusses explicit messages.
The type of a system message is indicated in the first word of the message. Explicit
messages include the following:
The Open and Close messages can be useful for several reasons; for example:
To monitor how many processes have this process open
To limit which processes are allowed to open the server
To properly service a requester that is run as a fault-tolerant process pair
The Control, Setmode, Setparam, and Controlbuf messages are used if your program
simulates an I/O device. Simple examples of handling these messages are given here.
For a detailed example of handling the Open and Close system messages, see
Section 22, Writing a Server Program. For details of I/O device simulation, see
Section 24, Writing a Terminal Simulator.
The Guardian Procedure Errors and Messages Manual provides the format and
recommended response for every system message that the operating system might
generate.
-32 (Control message) Another process issued a CONTROL procedure call
against this process.
-33 (Setmode message) Another process issued a SETMODE procedure call
against this process.
-34 (Resetsync
message)
Another process issued a RESETSYNC procedure call
against this process.
-35 (Controlbuf
message)
Another process issued a CONTROLBUF procedure call
against this process.
-37 (Setparam message) Another process issued a SETPARAM procedure call
against this process.
-103 (Open message) Another process attempted to open this process.
-104 (Close message) Another process attempted to close this process.