Set a sigevent to deliver when a new event becomes available.


#include <mm/renderer/events.h>
int mmr_event_arm( mmr_context_t *ctxt, 
                   struct sigevent const *sev )



A context handle.


A sigevent to send; set to NULL to disarm.




Set a sigevent to deliver when a new mm-renderer event becomes available. The mmr_event_arm() function is helpful if your program already has an event-processing loop that uses signals or pulses as notifications and you simply want to add code that processes mm-renderer events. To do this, call mmr_event_arm() ahead of the event-processing loop to enable mm-renderer event notifications. Then, in the loop section that handles mm-renderer events, call mmr_event_get() to retrieve the latest event.

The mmr_event_arm() function can't arm a sigevent if mm-renderer already has an event waiting. In this case, the function returns a value greater than zero; if you receive such a value, you should immediately call mmr_event_get() to retrieve the event.

Occasionally, the mmr_event_get() function can't retrieve any meaningful event data and instead returns the MMR_EVENT_NONE event. This can happen if the sigevent wasn't armed (because an event was already waiting) or if the sigevent was armed and then delivered by the system (because an event occurred sometime after the mmr_event_arm() call). For an example of a situation when MMR_EVENT_NONE might be returned, see mmr_event_wait().


A positive number if the sigevent can't be armed, zero on success, or -1 on failure (check errno).


QNX Neutrino

Interrupt handler No
Signal handler No
Thread No, except when using different context handles