Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Header: #include <applibs/sysevent.h>
Registers the application with a set of events.
Note
There must only be one active EventRegistration struct at a time for all system event notifications.
EventRegistration *SysEvent_RegisterForEventNotifications(EventLoop *el, SysEvent_Events eventBitmask SysEvent_EventsCallback callback_function, void *context);
Parameters
elThe event loop to which theEventRegistrationis registered.eventBitmaskA bitmask that indicates the event types to listen to.callbackFunctionA function handler that is called when the state of an event ineventBitmaskchanges.contextAn optional user context pointer that is passed to the events callback when an event occurs.
Errors
Returns NULL if an error is encountered and sets errno to the error value.
- EACCES: The application doesn't have the SystemEventNotifications capability.
- EFAULT: The
elorcallback_functionparameter is NULL. - EINVAL: The
eventBitmaskspecifies invalid events.
Any other errno may also be specified, but the same behavior might not be retained through system updates.
Return value
Returns a pointer to an EventRegistration struct, or NULL, in which case errno is set to the error value.
Remarks
The EventRegistration struct that is returned needs to be retained until it is passed to SysEvent_UnregisterForEventNotifications.
Application manifest requirements
The application manifest must include the SystemEventNotifications capability.