Example A-4 shows the source code for the spmi_dude.c program.
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <sys/Spmidef.h> #if defined(DEBUG) #define PDEBUG(x,y) printf(x,y) #else #define PDEBUG(x,y) #endif extern errno; extern charSpmiErrmsg; extern intSpmiErrno; /* * Since we need this structure pointer in our cleanup() function * we declare it as a global variable. */ struct SpmiStatSet*SPMIset = NULL; /* * These are the statistics we are interested in monitoring. * To the left of the last slash (/) is the context, to the * right of this slash (/) is the actual statistic within * the context. Note that statistics can have the same * name but belong to different contexts. ...