Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 3 89
Creating a Resource Monitor
Processing a Subclass Request Event
rc = rm_set(subclass, RmSubclassName, “ubit32”, &error_code);
if (rc == -1) {
rm_perror(“Error in rm_set“, error_code);
return -1;
}
rc = rm_set(obj, RmSubclassChildObject, subclass, &error_code);
if (rc == -1) {
rm_perror(“Error in rm_set“, error_code);
return -1;
}
/***********************************************************************/
/* Define a resource instance called “enum”. */
/***********************************************************************/
subclass = rm_create(RM_SUBCLASS_CHILD_OBJECT, &error_code);
if (!subclass) {
rm_perror(“Error in rm_create“, error_code);
return -1;
}
rc = rm_set(subclass, RmSubclassName, “enum”, &error_code);
if (rc == -1) {
rm_perror(“Error in rm_set“, error_code);
return -1;
}
rc = rm_set(obj, RmSubclassChildObject, subclass, &error_code);
if (rc == -1) {
rm_perror(“Error in rm_set“, error_code);
return -1;
}
/***********************************************************************/
/* Define a resource instance called “float”. */
/***********************************************************************/
subclass = rm_create(RM_SUBCLASS_CHILD_OBJECT, &error_code);
if (!subclass) {
rm_perror(“Error in rm_create“, error_code);
return -1;
}
rc = rm_set(subclass, RmSubclassName, “float”, &error_code);
if (rc == -1) {
rm_perror(“Error in rm_set“, error_code);
return -1;
}