1SIGEVENT(7) Linux Programmer's Manual SIGEVENT(7)
2
3
4
6 sigevent - structure for notification from asynchronous routines
7
9 union sigval { /* Data passed with notification */
10 int sival_int; /* Integer value */
11 void *sival_ptr; /* Pointer value */
12 };
13
14 struct sigevent {
15 int sigev_notify; /* Notification method */
16 int sigev_signo; /* Notification signal */
17 union sigval sigev_value; /* Data passed with
18 notification */
19 void (*sigev_notify_function) (union sigval);
20 /* Function used for thread
21 notification (SIGEV_THREAD) */
22 void *sigev_notify_attributes;
23 /* Attributes for notification thread
24 (SIGEV_THREAD) */
25 pid_t sigev_notify_thread_id;
26 /* ID of thread to signal (SIGEV_THREAD_ID) */
27 };
28
30 The sigevent structure is used by various APIs to describe the way a
31 process is to be notified about an event (e.g., completion of an asyn‐
32 chronous request, expiration of a timer, or the arrival of a message).
33
34 The definition shown in the SYNOPSIS is approximate: some of the fields
35 in the sigevent structure may be defined as part of a union. Programs
36 should employ only those fields relevant to the value specified in
37 sigev_notify.
38
39 The sigev_notify field specifies how notification is to be performed.
40 This field can have one of the following values:
41
42 SIGEV_NONE
43 A "null" notification: don't do anything when the event occurs.
44
45 SIGEV_SIGNAL
46 Notify the process by sending the signal specified in
47 sigev_signo.
48
49 If the signal is caught with a signal handler that was regis‐
50 tered using the sigaction(2) SA_SIGINFO flag, then the follow‐
51 ing fields are set in the siginfo_t structure that is passed as
52 the second argument of the handler:
53
54 si_code This field is set to a value that depends on the API
55 delivering the notification.
56
57 si_signo This field is set to the signal number (i.e., the
58 same value as in sigev_signo).
59
60 si_value This field is set to the value specified in
61 sigev_value.
62
63 Depending on the API, other fields may also be set in the sig‐
64 info_t structure.
65
66 The same information is also available if the signal is
67 accepted using sigwaitinfo(2).
68
69 SIGEV_THREAD
70 Notify the process by invoking sigev_notify_function "as if" it
71 were the start function of a new thread. (Among the implemen‐
72 tation possibilities here are that each timer notification
73 could result in the creation of a new thread, or that a single
74 thread is created to receive all notifications.) The function
75 is invoked with sigev_value as its sole argument. If
76 sigev_notify_attributes is not NULL, it should point to a
77 pthread_attr_t structure that defines attributes for the new
78 thread (see pthread_attr_init(3)).
79
80 SIGEV_THREAD_ID (Linux-specific)
81 Currently used only by POSIX timers; see timer_create(2).
82
84 POSIX.1-2001.
85
87 timer_create(2), aio_fsync(3), aio_read(3), aio_write(3), getad‐
88 drinfo_a(3), lio_listio(3), mq_notify(3), aio(7), pthreads(7)
89
91 This page is part of release 3.53 of the Linux man-pages project. A
92 description of the project, and information about reporting bugs, can
93 be found at http://www.kernel.org/doc/man-pages/.
94
95
96
97GNU 2011-09-09 SIGEVENT(7)