spe_event_wait - Wait for SPE events.
#include <libspe2.h>
int spe_event_wait(spe_event_handler_ptr_t evhandler, spe_event_unit_t *events, int max_events, int timeout);
evhandler | A valid pointer to the SPE event handler. |
events | The pointer to the memory area where the events will
be stored. The 'events' member will contain the event bit field indicating
the actual event received, and the 'spe' member will contain pointer
to the SPE context that generated the event. For the specification of spe_event_unit_t, see spe_event_handler_register. |
max_events | Maximum number of 'events' to receive. The call will return if at least one event has been received or if it times out. |
timeout | Timeout in milliseconds. -1 means 'infinite'. 0 means that the call should not wait but return immediately with as many events as are currently available up to a maximum of max_events. |
On success, the number of SPE events received. If 0 (zero) is returned, no SPE event was received because the request timed out.
On error, -1 is returned and errno is set to indicate the error.
Possible errors include:
ESRCH | The specified SPE event handler is invalid. |
EINVAL | Error in parameters. |
EFAULT | A runtime error of the underlying OS service occurred. |