![]() |
![]() |
![]() |
Structure that describes an event
#include <sys/siginfo.h> union sigval { int sival_int; void *sival_ptr; };
The sigevent structure is complicated; see below.
This structure describes an event. The int sigev_notify member indicates how the notification is to occur, as well as which of the other members are used:
sigev_notify | sigev_signo | sigev_coid | sigev_priority | sigev_code | sigev_value |
---|---|---|---|---|---|
SIGEV_INTR | |||||
SIGEV_NONE | |||||
SIGEV_PULSE | connection | priority | code | value | |
SIGEV_SIGNAL | signal | ||||
SIGEV_SIGNAL_CODE | signal | code | value | ||
SIGEV_SIGNAL_THREAD | signal | code | value | ||
SIGEV_THREAD (special -- see below) |
value | ||||
SIGEV_UNBLOCK |
The <sys/siginfo.h> file also defines some macros to make initializing the sigevent structure easier. All the macros take a pointer to a sigevent structure as their first argument, event, and set the sigev_notify member to the appropriate value.
Raise an interrupt. No other fields in the structure are used.
The initialization macro is:
SIGEV_INTR_INIT( event )
Don't send any notification. No other fields in the structure are used.
The initialization macro is:
SIGEV_NONE_INIT( event )
Send a pulse. The following fields are used:
The initialization macro is:
SIGEV_PULSE_INIT( event, coid, priority, code, value )
Send a signal to a process. The following fields are used:
The initialization macro is:
SIGEV_SIGNAL_INIT( event, signal )
![]() |
If you need to set the sigev_value for a SIGEV_SIGNAL event (for example if SA_SIGINFO is set), you'll have to initialize the sigevent structure manually. |
This is similar to SIGEV_SIGNAL, except that SIGEV_SIGNAL_CODE also includes a value and a code. The following fields are used:
The initialization macro is:
SIGEV_SIGNAL_CODE_INIT( event, signal, value, code )
Send a signal to a specific thread. The following fields are used:
The initialization macro is:
SIGEV_SIGNAL_THREAD_INIT( event, signal, value, code )
Create a new thread.
![]() |
We don't recommend using this type of event. Pulses are more efficient. |
The following fields are used:
The initialization macro is:
SIGEV_THREAD_INIT( event, fn, value, attr )
Force a thread to become unblocked. No other fields in the structure are used.
The initialization macro is:
SIGEV_UNBLOCK_INIT( event )
QNX 6
ds_create(), InterruptAttach(), InterruptAttachEvent(), iofunc_notify(), iofunc_notify_trigger(), ionotify(), lio_listio(), mq_notify(), MsgDeliverEvent(), procmgr_event_notify(), TimerCreate(), timer_create(), TimerInfo(), TimerTimeout(), timer_timeout()
"Neutrino IPC" in the Neutrino microkernel chapter of the System Architecture guide
![]() |
![]() |
![]() |