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