Writing Monitors for the Event Monitoring Service (December 1999)

Chapter 2 53
The EMS Application Programming Interface (API)
Function Descriptions
rm_set
Used by resource monitors to store data in an object. The caller passes
the object and data identifier of interest, and rm_set() assigns a
user-supplied address to store the result.
Function Prototype
int rm_set ( rm_object_addr obj,
rm_field_type field,
(value or address of)data,
rm_error_type *error_code );
Parameters
data
Depending on the type of the field specified, this parameter will be
a value or address. Table 2-9 summarizes this:
Table 2-9
data
Parameter Values
Field Type Value or
Address
rm_set Action
char * Address rm_set() allocates memory to expand
the size of the object obj by
strlen(data)+1.
Value pointed to by data is stored into
the object obj.
rm_object_addr Address An rm_object_addr is treated as a
void *.
rm_value_type * Address The data is assumed to be a Resource
Value or Threshold Value. Its size will
be determined by the corresponding
Resource Type or Threshold Type field
in obj.
If necessary, obj will be expanded to
hold the value pointed to by data.
ubit16
ubit32
time_t
rm_option_type
Value data is stored into the object obj as a
value.