Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 2 35
The EMS Application Programming Interface (API)
Function Descriptions
rm_copy
Called by resource monitors to clone an object.
Function Prototype
rm_object_addr rm_copy ( const rm_object_addr obj,
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.
obj
The object to be copied.
Returned Value
Upon successful completion, rm_copy() returns the new object. 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.
The new object is created by the EMS API and has its own copy of the
data stored in obj. Therefore, calling rm_destroy() on obj will not
affect the new object.
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_copy() returns an error, no object is created, so it is
not necessary to call rm_destroy().