1 .\" $NetBSD: knote.9,v 1.11 2004/02/18 16:50:25 jdolecek Exp $
3 .\" Copyright (c) 2001, 2002, 2003 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This documentation is derived from text contributed by
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
36 .Nd raise kernel event
40 .Fn knote "struct klist *list" "long hint"
41 .Fn KNOTE "struct klist *list" "long hint"
45 function provides a hook into the kqueue kernel event notification
46 mechanism to allow sections of the kernel to raise a kernel event
57 of knotes, along with a
59 (which is passed to the appropriate filter routine).
63 making calls to the filter routine for each knote.
64 As each knote contains a reference to the data structure that it is
65 attached to, the filter may choose to examine the data structure in
66 deciding whether an event should be reported.
69 is used to pass in additional information, which may not be present in
70 the data structure that the filter examines.
72 If the filter decides that the event should be returned, it returns a
75 links the knote onto the tail end of the active list in the
76 corresponding kqueue for the application to retrieve.
77 If the knote is already on the active list, no action is taken, but the
78 call to the filter occurs in order to provide an opportunity for the
79 filter to record the activity.
82 must not be called from interrupt contexts running at an interrupt
83 priority level higher than
95 .Xr kfilter_register 9
101 functions first appeared in
108 system was written by
109 .An Jonathan Lemon Aq jlemon@FreeBSD.org .