SIGEVENT(3) | MidnightBSD Library Functions Manual | SIGEVENT(3) |
sigevent
—
asynchronous event notification
#include
<signal.h>
Some operations permit threads to request asynchronous notification of events via a struct sigevent structure. This structure contains several fields that describe the requested notification:
Type | Member | Description |
int | sigev_notify | notification method |
int | sigev_signo | signal number |
union sigval | sigev_value | signal value |
int | sigev_notify_kqueue | kqueue(2) file descriptor |
unsigned short | sigev_notify_kevent_flags | kevent flags |
lwpid_t | sigev_notify_thread_id | LWP ID |
void (*)(union sigval) | sigev_notify_function | callback function pointer |
pthread_attr_t * | sigev_notify_attributes | callback thread attributes |
The sigev_notify field specifies the notification method used when the event triggers:
SIGEV_NONE
SIGEV_SIGNAL
SIGEV_THREAD
NULL
, the thread is created with default
attributes.SIGEV_KEVENT
SIGEV_THREAD_ID
Note that programs wishing to use
SIGEV_THREAD
notifications must link against the
POSIX Real-time Library (librt, -lrt).
The sigevent structure first appeared in FreeBSD 3.3.
The struct sigevent type conforms to IEEE Std 1003.1-2004 (“POSIX.1”).
February 25, 2020 | midnightbsd-3.1 |