Writing Monitors for the Event Monitoring Service (December 1999)

54 Chapter2
The EMS Application Programming Interface (API)
Function Descriptions
error_code
Provides additional information about failure conditions of
the function. Valid values are listed in the file
/opt/resmon/include/resmon.h.
field
A value that identifies which portion of the object is of interest.
The valid field specifiers associated
with each object are described in the chapter, “Creating a Resource
Monitor.
obj
The object where the data should be stored.
Returned Value
Upon successful completion, rm_set() returns 0. If an error occurs, the
value returned is -1, and error_code is set to one of the values described
in the file /opt/resmon/include/resmon.h.
Usage Notes
This function may allocate memory to store the data in the object. Any
data allocated by rm_set() is freed by rm_destroy(). It is crucial that
the user application call rm_destroy() when the object is no longer
needed.
When you use rm_set() to set the values in a Subclass Reply object or a
Resource Update object, rm_set() does not copy Resource State objects
for resources of type RM_ENUMERATED_TYPE. You must use rm_create()
or rm_copy() to add Resource State objects to a Subclass Reply object or
Resource Update object. See the sections, “Processing a Subclass Request
Event” or “Processing a Resource Update Event.
void * Address rm_set() allocates memory to expand
the size of the object obj by enough
bytes to hold the value.
Value pointed to by data is stored into
the object obj.
Table 2-9
data
Parameter Values
Field Type Value or
Address
rm_set Action