sigevent(3type) | sigevent(3type) |
sigevent, sigval - structure for notification from asynchronous routines
#include <signal.h>
struct sigevent { int sigev_notify; /* Notification type */ int sigev_signo; /* Signal number */ union sigval sigev_value; /* Data passed with notification */ void (*sigev_notify_function)(union sigval); /* Notification function (SIGEV_THREAD) */ pthread_attr_t *sigev_notify_attributes; /* Notification attributes */ /* Linux only: */ pid_t sigev_notify_thread_id; /* ID of thread to signal (SIGEV_THREAD_ID) */ };
union sigval { /* Data passed with notification */ int sival_int; /* Integer value */ void *sival_ptr; /* Pointer value */ };
The sigevent structure is used by various APIs to describe the way a process is to be notified about an event (e.g., completion of an asynchronous request, expiration of a timer, or the arrival of a message).
The definition shown in the SYNOPSIS is approximate: some of the fields in the sigevent structure may be defined as part of a union. Programs should employ only those fields relevant to the value specified in sigev_notify.
The sigev_notify field specifies how notification is to be performed. This field can have one of the following values:
Data passed with a signal.
POSIX.1-2008.
POSIX.1-2001.
<aio.h> and <time.h> define sigevent since POSIX.1-2008.
The following headers also provide sigevent: <aio.h>, <mqueue.h>, and <time.h>.
timer_create(2), getaddrinfo_a(3), lio_listio(3), mq_notify(3), pthread_sigqueue(3), sigqueue(3), aiocb(3type), siginfo_t(3type)
2023-10-31 | Linux man-pages 6.7 |