1 .\" Copyright (C) 2006, 2010 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" Copyright (C) 2009 Petr Baudis <pasky@suse.cz>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .TH SIGEVENT 7 2021-03-22 "GNU" "Linux Programmer's Manual"
28 sigevent \- structure for notification from asynchronous routines
33 union sigval { /* Data passed with notification */
34 int sival_int; /* Integer value */
35 void *sival_ptr; /* Pointer value */
39 int sigev_notify; /* Notification method */
40 int sigev_signo; /* Notification signal */
41 union sigval sigev_value;
42 /* Data passed with notification */
43 void (*sigev_notify_function)(union sigval);
44 /* Function used for thread
45 notification (SIGEV_THREAD) */
46 void *sigev_notify_attributes;
47 /* Attributes for notification thread
49 pid_t sigev_notify_thread_id;
50 /* ID of thread to signal
51 (SIGEV_THREAD_ID); Linux-specific */
57 structure is used by various APIs
58 to describe the way a process is to be notified about an event
59 (e.g., completion of an asynchronous request, expiration of a timer,
60 or the arrival of a message).
62 The definition shown in the SYNOPSIS is approximate:
63 some of the fields in the
65 structure may be defined as part of a union.
66 Programs should employ only those fields relevant
67 to the value specified in
72 field specifies how notification is to be performed.
73 This field can have one of the following values:
76 A "null" notification: don't do anything when the event occurs.
79 Notify the process by sending the signal specified in
82 If the signal is caught with a signal handler that was registered using the
85 flag, then the following fields are set in the
87 structure that is passed as the second argument of the handler:
91 This field is set to a value that depends on the API
92 delivering the notification.
95 This field is set to the signal number (i.e., the same value as in
99 This field is set to the value specified in
103 Depending on the API, other fields may also be set in the
107 The same information is also available if the signal is accepted using
111 Notify the process by invoking
112 .I sigev_notify_function
113 "as if" it were the start function of a new thread.
114 (Among the implementation possibilities here are that
115 each timer notification could result in the creation of a new thread,
116 or that a single thread is created to receive all notifications.)
117 The function is invoked with
119 as its sole argument.
121 .I sigev_notify_attributes
122 is not NULL, it should point to a
124 structure that defines attributes for the new thread (see
125 .BR pthread_attr_init (3)).
127 .BR SIGEV_THREAD_ID " (Linux-specific)"
128 .\" | SIGEV_SIGNAL vs not?
129 Currently used only by POSIX timers; see
130 .BR timer_create (2).
132 .BR timer_create (2),
136 .BR getaddrinfo_a (3),