Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 2 39
The EMS Application Programming Interface (API)
Function Descriptions
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
chapters, “Creating a Resource Monitor” and “Writing a Target
Application.”
obj
The object that contains the data item to be retrieved.
Returned Value
Upon successful completion, rm_get() 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
If the field is an enumerated type (like an object type) or a character
string, the address of the field inside the EMS object is returned in the
addr field. The data is not copied. Therefore, if you destroy the object
pointed to by obj, you also destroy the value pointed to by addr.
Likewise, if addr points to an enumerated or character type, and you
free(3C) the memory pointed to by addr, the corresponding field of the
object obj is actually destroyed. For enumerated and character types,
you should copy the data pointed to by addr after calling rm_get() if you
need to reference it after the containing object has been destroyed.
If the field you want to obtain data from is an integer, rm_get copies the
value to the location pointed to by addr, and you can destroy the object
obj without affecting the contents of addr.
The only supported method of modifying object data is through the
rm_set() function. Any other method of modifying data inside an object
is unsupported. Similarly, rm_get() is the only supported method of
obtaining data from an object.