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