Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 38
Program Declarations
#define PHANDLESIZE 10
#define NULLPHANDLE {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
/* Primary process attribute code for PROCESS_SETINFO_ */
# define PRIMARY_ATTRIBUTE 47
/* File number of the backup process. Used by the primary
process to send information to the backup */
short backup_filenum;
/* Global data */
short counter = 0;
/* Variable for use by the backup to hold the counter state
value sent by the primary */
short counter_state;
/*The following structure defines the various message formats
used by this program.*/
typedef struct
{
short msgnumber; /*message number*/
union
{
/*one member for each message format*/
/*UPDATE_MESSAGE message*/
short counter_value;
/*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;