Writing Monitors for the Event Monitoring Service (December 1999)
36 Chapter2
The EMS Application Programming Interface (API)
Function Descriptions
rm_create
Used by resource monitors to create objects.
Function Prototype
rm_object_addr rm_create ( rm_object_type type,
rm_error_type *error_code );
Parameters
error_code
Provides additional information about failure conditions of
the function. Valid values are listed in the file
/opt/resmon/include/resmon.h.
type
The type of object the user wishes to create. Valid values (defined
in resmon.h) are listed in Table 2-5:
Returned Value
Upon successful completion, rm_create() returns the object requested.
If an error occurs, the value returned is (rm_object_addr)NULL, and
error_code is set to one of the values described in the file
/opt/resmon/include/resmon.h.
Usage Notes
This function allocates memory using malloc(3C). The memory must be
freed by the user using the rm_destroy() function when the object is no
longer needed. If rm_create() returns an error, no object is created, so it
is not necessary to call rm_destroy().
Table 2-5 rm_object_type
type
Parameter Values
Type Value Description
RM_SUBCLASS_CHILD_OBJECT possibly created as part of a reply to a
Subclass Request
RM_RESOURCE_STATE_OBJECT
RM_RESOURCE_UPDATE_OBJECT created when asynchronously
updating a resource value before
calling rm_notify()