3 .\" Copyright (c) 2016 John H. Baldwin <jhb@FreeBSD.org>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd "asynchronous event notification"
38 Some operations permit threads to request asychronous notification of events
42 This structure contains several fields that describe the requested notification:
43 .Bl -column ".Vt void (*)(union sigval)" ".Va sigev_notify_kevent_flags"
44 .It Sy Type Ta Sy Member Ta Sy Description
45 .It Vt int Ta sigev_notify Ta notification method
46 .It Vt int Ta sigev_signo Ta signal number
47 .It Vt union sigval Ta sigev_value Ta signal value
48 .It Vt int Ta sigev_notify_kqueue Ta
51 .It Vt unsigned short Ta sigev_notify_kevent_flags Ta kevent flags
52 .It Vt lwpid_t Ta sigev_notify_thread_id Ta LWP ID
53 .It Vt void (*)(union sigval) Ta sigev_notify_function Ta
54 callback function pointer
55 .It Vt pthread_attr_t * Ta sigev_notify_attributes Ta
56 callback thread attributes
61 field specifies the notification method used when the event triggers:
62 .Bl -tag -width ".Dv SIGEV_THREAD_ID"
64 No notification is sent.
68 is queued as a real-time signal to the calling process.
71 will be present in the
75 structure of the queued signal.
77 The notification function in
78 .Va sigev_notify_function
79 is called in a separate thread context.
80 The thread is created with the attributes specified in
81 .Va *sigev_notify_attributes .
84 is passed as the sole argument to
85 .Va sigev_notify_function .
87 .Va sigev_notify_attributes
90 the thread is created with default attributes.
92 A new kevent is posted to the kqueue
93 .Va sigev_notify_kqueue .
96 member of the kevent structure contains the value stored in
98 The meaning of other fields in the kevent are specific to the type of triggered
100 .It Dv SIGEV_THREAD_ID
103 is queued to the thread whose LWP ID is
104 .Va sigev_notify_thread_id .
107 will be present in the
111 structure of the queued signal.
114 Note that programs wishing to use
116 notifications must link against the