sigevent
Sigevent refers to a POSIX structure that describes how a process or thread should be notified when a specified asynchronous event occurs. It is most commonly used with POSIX timers (via timer_create) and message queue notifications (via mq_notify), but can be involved with other asynchronous mechanisms as well. The notification method is selected by the sigev_notify field and can be delivered as a signal, by invoking a function in a new thread, or not delivered at all.
The typical members of struct sigevent include:
- sigev_notify: the notification type, such as SIGEV_SIGNAL, SIGEV_THREAD, or SIGEV_NONE. Some systems also support extended options
- sigev_signo: the signal number to deliver when using SIGEV_SIGNAL.
- sigev_value: a union (sigval) that carries data to the notification. For signals, this data is accessible
- sigev_notify_function: a pointer to the function to invoke when using SIGEV_THREAD.
- sigev_notify_attributes: a pointer to thread attributes to use when creating the notification thread (platform-dependent).
The related type sigval, defined as union sigval, can hold either an int or a void* (commonly
Implementation details vary by system. In timer_create, the kernel copies the sigevent content when establishing the