There are some
convenience macros in <sys/siginfo.h> to make filling in the
notification structures easier (see the entry for
sigevent in the QNX Neutrino C Library Reference):
- SIGEV_SIGNAL_INIT (eventp, signo)
- Fill eventp with SIGEV_SIGNAL, and the appropriate
signal number signo.
- SIGEV_SIGNAL_CODE_INIT (eventp, signo, value, code)
- Fill eventp with SIGEV_SIGNAL_CODE, the
signal number signo, as well as the value and code.
- SIGEV_SIGNAL_THREAD_INIT (eventp, signo, value, code)
- Fill eventp with SIGEV_SIGNAL_THREAD, the
signal number signo, as well as the value and code.
- SIGEV_PULSE_INIT (eventp, coid, priority, code, value)
- Fill eventp with SIGEV_SIGNAL_PULSE, the
connection to the channel in coid and a priority, code,
and value.
Note that there is a special value for priority of SIGEV_PULSE_PRIO_INHERIT that
causes the receiving thread to run at the process's initial priority.
- SIGEV_UNBLOCK_INIT (eventp)
- Fill eventp with SIGEV_UNBLOCK.
- SIGEV_INTR_INIT (eventp)
- Fill eventp with SIGEV_INTR.
- SIGEV_THREAD_INIT (eventp, func, val, attributes)
- Fill eventp with the thread function (func) and
the attributes structure (attributes).
The value in val is passed to the function in func when the thread is executed.