KNOTE(9) BSD Kernel Manual KNOTE(9)
knote, KNOTE - raise kernel event
#include <sys/param.h> #include <sys/event.h> void knote(struct klist *list, long hint); KNOTE(struct klist *list, long hint);
The knote() function provides a hook into the kqueue kernel event notifi- cation mechanism to allow sections of the kernel to raise a kernel event in the form of a 'knote', which is a struct knote as defined in <sys/event.h>. knote() takes a singly linked list of knotes, along with a hint (which is passed to the appropriate filter routine). knote() then walks the list making calls to the filter routine for each knote. As each knote contains a reference to the data structure that it is attached to, the filter may choose to examine the data structure in deciding whether an event should be reported. The hint is used to pass in additional information, which may not be present in the data structure that the filter examines. If the filter decides that the event should be returned, it returns a non-zero value and knote() links the knote onto the tail end of the ac- tive list in the corresponding kqueue for the application to retrieve. If the knote is already on the active list, no action is taken, but the call to the filter occurs in order to provide an opportunity for the filter to record the activity. knote() must not be called from interrupt contexts running at an inter- rupt priority level higher than splsched(). KNOTE() is a macro that calls knote(list, hint) if list is not empty.
The knote() and KNOTE() functions first appeared in FreeBSD 4.1, and then in OpenBSD 2.9.
The kqueue() system was written by Jonathan Lemon <jlemon@FreeBSD.org>. MirOS BSD #10-current February 23, 2003 1
Generated on 2014-07-04 21:17:45 by $MirOS: src/scripts/roff2htm,v 1.79 2014/02/10 00:36:11 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002‒2014 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.