Guardian Application Conversion Guide

Being Opened by and Communicating With a High-PIN Requester
Converting C Applications
096047 Tandem Computers Incorporated 5–27
Opening $RECEIVE
Your server might open $RECEIVE using the OPEN procedure with bit 1 of the
flags
parameter set to 1 (
flags
= 040000). This allows you to receive system messages
such as -30 (Process open) and -31 (Process close):
short receive_name[12] = "$RECEIVE ";
short read_open_close_msgs = 040000 ;
...
status = OPEN (receive_name,
receive_file_number,
read_open_close_msgs, /* Value = octal 40000*/
receive_depth);
Convert your server to open $RECEIVE using the FILE_OPEN_ procedure:
1. Use a file-name string for the $RECEIVE file name instead of the internal file-name
format. Specify the length as a separate integer value.
2. Make sure that bit 15 of the FILE_OPEN_
options
parameter is zero (the default
value). If this bit is not zero, system messages such as -103 (Process open) and -104
(Process close) are not sent to $RECEIVE.
3. Make sure that bit 14 of the FILE_OPEN_
options
parameter is zero (the default
value) so that the system sends D-series system messages to $RECEIVE. If this bit
is not zero, the system sends C-series system messages to $RECEIVE.
4. Set any other FILE_OPEN_ input parameters as required and call the procedure:
#define receive_name_length 8;
char receive_name[receive_name_length + 1] = "$RECEIVE";
...
/* Open $RECEIVE to read D-series system messages */
error = FILE_OPEN_(receive_name,
receive_name_length,
receive_file_number,
/* access_mode */ ,
/* exclusion_mode */ ,
nowait_operations,
receive_depth);
If you open $RECEIVE using the FILE_OPEN_ procedure, the system assumes that
you support high-PIN requesters (provided bit 14 of the
options
parameter is zero).
You do not need to explicitly set the HIGHREQUESTERS object-file attribute in your
server’s object file.
When you close $RECEIVE, use either the CLOSE or FILE_CLOSE_ procedure.