Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 2 41
The EMS Application Programming Interface (API)
Function Descriptions
select_data
Contains both call and return values. The resource
monitor optionally supplies values that determine whether any file
descriptors other than the EMS API communications socket should be
monitored for data traffic using select(2). Upon return, the file
descriptors that have data are marked.
If select_data is NULL, the EMS API blocks indefinitely until a
Resource Monitor message arrives.
Table 2-7 lists the fields of the rm_select_type data structure that are
(optionally) used:
RM_SELECT_EVENT A call to select(2) returned with one of the
user-specified file descriptors selected. The numfds,
readfds, writefds, and exceptfds fields
should be examined for useful data. See select(2)
for more information.
RM_SUBCLASS_
REQUEST_EVENT
A Subclass Request message has been received from
the EMS API. The resource monitor is expected to
send a Subclass Reply. See the section, “Processing a
Subclass Request Event” for more information.
RM_TERMINATE_
EVENT
A timer popped indicating that no activity associated
with this monitor has occurred in the last 60 minutes.
That means no requests are outstanding. The resource
monitor may terminate after receiving this message.
See the section, “Processing a Terminate Event” for
more information.
RM_TIMEOUT_
EVENT
No events occurred in the time interval allotted for the
rm_get_next_event() function. This event
occurs only when the resource monitor sets a timeout
in the select(2) parameters. See select(2) for
more information.
RM_UNREGISTER_
EVENT
A monitor request has been unregistered. See the
section, “Processing an Unregister Event” for more
information.
Table 2-6 rm_return_type
return_type
Parameter Values
Type Description