[Previous] [Contents] [Next]

InterruptWait(), InterruptWait_r()

Wait for a hardware interrupt

Synopsis:

#include <sys/neutrino.h>

int InterruptWait( int flags,
                   const uint64_t * timeout );

int InterruptWait_r( int flags,
                     const uint64_t * timeout );

Library:

libc

Description:

The InterruptWait() and InterruptWait_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls wait for a hardware interrupt. The calling thread should have attached a handler to the interrupt using the InterruptAttach() or InterruptAttachEvent() kernel calls. The call blocks waiting for an interrupt handler to return an event with notification type SIGEV_INTR (i.e. a hardware interrupt).

If the notification event occurs before InterruptWait() is called, a pending flag is set. When InterruptWait() is called, the flag is checked and if set, it's cleared and the call immediately returns with success.

The flags variable should be 0, and timeout should be passed as NULL. This may change in future versions.


Note: Use TimerTimeout() to achieve a timeout.

Blocking states

STATE_INTR
The thread is waiting for an interrupt handler to return a SIGEV_INTR event.

Returns:

The only difference between these functions is the way they indicate errors:

InterruptWait()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
InterruptWait_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EINTR
The call was interrupted by a signal.
ENOTSUP
The reserved arguments aren't NULL.
ETIMEDOUT
A kernel timeout unblocked the call. See TimerTimeout().

Classification:

QNX 6

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

InterruptAttach(), InterruptAttachEvent(), TimerTimeout()


[Previous] [Contents] [Next]