System Event Library Functions sysevent_bind_handle(3SYSEVENT)
NAME
sysevent_bind_handle, sysevent_unbind_handle - bind or
unbind subscriber handleSYNOPSIS
cc [flag...] file ... -lsysevent [library ...]
#include
sysevent_handle_t *sysevent_bind_handle(void (*event_handler)
(sysevent_t *ev));
void sysevent_unbind_handle(sysevent_handle_t *sysevent_hdl);
PARAMETERS
ev pointer to sysevent buffer handleevent_handler pointer to an event handling function
sysevent_hdl pointer to a sysevent subscriber handle
DESCRIPTION
The sysevent_bind_handle() function allocates memory associ-
ated with a subscription handle and binds it to the caller'sevent_handler. The event_handler is invoked during subse-
quent system event notifications once a subscription hasbeen made with sysevent_subscribe_event(3SYSEVENT).
The system event is represented by the argument ev and ispassed as an argument to the invoked event delivery func-
tion, event_handler.
Additional threads are created to service communication between syseventd(1M) and the calling process and to run theevent handler routine, event_handler.
The sysevent_unbind_handle() function deallocates memory and
other resources associated with a subscription handle and deactivates all system event notifications for the calling process. All event notifications are guaranteed to stopupon return from sysevent_unbind_handle().
RETURN VALUES
The sysevent_bind_handle() function returns a valid sysevent
subscriber handle if the handle is successfully allocated.SunOS 5.11 Last change: 24 Jul 2009 1
System Event Library Functions sysevent_bind_handle(3SYSEVENT)
Otherwise, NULL is returned and errno is set to indicate the error.The sysevent_unbind_handle() function returns no value.
ERRORS
The sysevent_bind_handle() function will fail if:
EACCES The calling process has an ID other than the privileged user. EBUSY There are no resources available.EINVAL The pointer to the function event_handler is NULL.
EMFILE The process has too many open descriptors. ENOMEM There are insufficient resources to allocate the handle.ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | MT-Safe |
|_____________________________|_____________________________|
SEE ALSO
syseventd(1M), sysevent_subscribe_event(3SYSEVENT), attri-
butes(5) NOTES Event notifications are revoked by syseventd when the bound process dies. Event notification is suspended if a signalis caught and handled by the event_handler thread. Event
notification is also suspended when the calling process attempts to use fork(2) or fork1(2). Event notifications might be lost during suspension periods.SunOS 5.11 Last change: 24 Jul 2009 2
System Event Library Functions sysevent_bind_handle(3SYSEVENT)
The libsysevent interfaces do not work at all in non-global
zones.SunOS 5.11 Last change: 24 Jul 2009 3