Parameters

event_class

system event class string

event_subclass_list

array of subclass strings

num_subclasses

number of subclass strings

sysevent_hdl

sysevent subscriber handle

Description

The sysevent_subscribe_event() function registers the caller's interest in event notifications belonging to
the class event_class and the subclasses contained in event_subclass_list. The subscriber
handle sysevent_hdl is updated with the new subscription and the calling process receives
event notifications from the event handler specified in sysevent_bind_handle.

System events matching event_class and a subclass contained in event_subclass_list published after
the caller returns from sysevent_subscribe_event() are guaranteed to be delivered to the
calling process. Matching system events published and queued prior to a call
to sysevent_subscribe_event() may be delivered to the process's event handler.

The num_subclasses argument provides the number of subclass string elements in event_subclass_list.

A caller can use the event class EC_ALL to subscribe to all
event classes and subclasses. The event class EC_SUB_ALL can be used to
subscribe to all subclasses within a given event class.

Subsequent calls to sysevent_subscribe_event() are allowed to add additional classes or subclasses.
To remove an existing subscription, sysevent_unsubscribe_event() must be used to remove
the subscription.

The sysevent_unsubscribe_event() function removes the subscription described by event_class for sysevent_hdl.
Event notifications matching event_class will not be delivered to the calling process
upon return.

A caller can use the event class EC_ALL to remove all subscriptions
for sysevent_hdl.

The library manages all subscription resources.

Return Values

The sysevent_subscribe_event() function returns 0 if the subscription is successful. Otherwise, -1
is returned and errno is set to indicate the error.

The sysevent_unsubscribe_event() function returns no value.

Errors

The sysevent_subscribe_event() function will fail if:

EACCES

The calling process has an ID other than the privileged user.

EINVAL

The sysevent_hdl argument is an invalid sysevent handle.

ENOMEM

There is insufficient memory available to allocate subscription resources.