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 2015-08-08 "GNU" "Linux Programmer's Manual"
28 sigevent \- structure for notification from asynchronous routines
32 union sigval { /* Data passed with notification */
33 int sival_int; /* Integer value */
34 void *sival_ptr; /* Pointer value */
38 int sigev_notify; /* Notification method */
39 int sigev_signo; /* Notification signal */
40 union sigval sigev_value; /* Data passed with
42 void (*sigev_notify_function) (union sigval);
43 /* Function used for thread
44 notification (SIGEV_THREAD) */
45 void *sigev_notify_attributes;
46 /* Attributes for notification thread
48 pid_t sigev_notify_thread_id;
49 /* ID of thread to signal (SIGEV_THREAD_ID) */
56 structure is used by various APIs
57 to describe the way a process is to be notified about an event
58 (e.g., completion of an asynchronous request, expiration of a timer,
59 or the arrival of a message).
61 The definition shown in the SYNOPSIS is approximate:
62 some of the fields in the
64 structure may be defined as part of a union.
65 Programs should employ only those fields relevant
66 to the value specified in
71 field specifies how notification is to be performed.
72 This field can have one of the following values:
75 A "null" notification: don't do anything when the event occurs.
78 Notify the process by sending the signal specified in
81 If the signal is caught with a signal handler that was registered using the
84 flag, then the following fields are set in the
86 structure that is passed as the second argument of the handler:
90 This field is set to a value that depends on the API
91 delivering the notification.
94 This field is set to the signal number (i.e., the same value as in
98 This field is set to the value specified in
102 Depending on the API, other fields may also be set in the
106 The same information is also available if the signal is accepted using
110 Notify the process by invoking
111 .I sigev_notify_function
112 "as if" it were the start function of a new thread.
113 (Among the implementation possibilities here are that
114 each timer notification could result in the creation of a new thread,
115 or that a single thread is created to receive all notifications.)
116 The function is invoked with
118 as its sole argument.
120 .I sigev_notify_attributes
121 is not NULL, it should point to a
123 structure that defines attributes for the new thread (see
124 .BR pthread_attr_init (3)).
126 .BR SIGEV_THREAD_ID " (Linux-specific)"
127 .\" | SIGEV_SIGNAL vs not?
128 Currently used only by POSIX timers; see
129 .BR timer_create (2).
131 .BR timer_create (2),
135 .BR getaddrinfo_a (3),