Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 2 43
The EMS Application Programming Interface (API)
Function Descriptions
Returned Value
Upon successful completion, rm_get_next_event() returns 0 and
creates an object to indicate what type of event occurred. 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.
If rm_get_next_event() returns an error, no object is created, so it is
not necessary to call rm_destroy().
Usage Notes
If the resource monitor is written in such a way that it cannot block
indefinitely, parameters are provided that are similar to those found in
select(2). These parameters can be used to specify file descriptors that
should be watched for activity. They can also be used to specify a
maximum blocking time. Use of these parameters is optional, and should
be necessary only for resource monitors that need to listen to multiple
communication channels in order to monitor the resources they support.
timeout struct
timeva
l *
If the timeout argument is not a null pointer, it
points to an object of type struct timeval
that specifies a maximum interval to wait for the
selection to complete. Resource monitors that can
block indefinitely should set this field to NULL.
See select(2) for more information.
writefds fd_set On input specifies the file descriptors to be
checked for being ready to write, and on output
indicates which file descriptors are ready to write.
Note: Messages from the EMS API have a lower
priority than other messages. They will be
processed only when the file descriptors in
readfds, writefds, and exceptfds do not
contain pending messages.
Resource Monitors that do not need to use this
field should set it to all zeros. See select(2) for
more information.
Table 2-7 rm_select_type
select_data
Parameter Fields
Field Name Type Description