Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 57
Program Declarations
/*CPU_DOWN message*/
short cpu_down_info;
/*PROCESS_DELETION message, variable-length fields
are assumed to have zero length*/
short process_death_notification_info [40];
} msg_variants;
} message_format;
Miscellaneous Declarations
Finally, the program contains miscellaneous declarations to define the following:
The $RECEIVE file name.
The maximum file-name length.
The size of the process handle, and a null process handle. A process handle is
10 words long, and a null process handle has all ten words set to -1.
The file number of the backup process. This number is used by the primary
process to send information to the backup process.
A variable to be used by the backup process to hold the counter state value sent
by the primary process.
The declarations are as follows:
#define RECEIVE_FILENAME "$RECEIVE"
/*Maximum file-name length (plus 1 to allow for null
terminator)*/
#define MAXNAMELEN 36
/*Process handle size and null process handle*/
#define PHANDLESIZE 10
#define NULLPHANDLE {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
/*Primary process attribute code*/
#define PRIMARY_ATTRIBUTE 47
/*File number of the backup process; used by the primary
process to send state information to the backup*/
short backup_filenum;
/*File pointers*/
FILE *infile;
FILE *outfile;