1*805a1ce9Schristos /* $NetBSD: kqueue-internal.h,v 1.1.1.1 2017/01/31 21:14:52 christos Exp $ */ 2*805a1ce9Schristos /* 3*805a1ce9Schristos * Copyright (c) 2012 Niels Provos and Nick Mathewson 4*805a1ce9Schristos * 5*805a1ce9Schristos * Redistribution and use in source and binary forms, with or without 6*805a1ce9Schristos * modification, are permitted provided that the following conditions 7*805a1ce9Schristos * are met: 8*805a1ce9Schristos * 1. Redistributions of source code must retain the above copyright 9*805a1ce9Schristos * notice, this list of conditions and the following disclaimer. 10*805a1ce9Schristos * 2. Redistributions in binary form must reproduce the above copyright 11*805a1ce9Schristos * notice, this list of conditions and the following disclaimer in the 12*805a1ce9Schristos * documentation and/or other materials provided with the distribution. 13*805a1ce9Schristos * 3. The name of the author may not be used to endorse or promote products 14*805a1ce9Schristos * derived from this software without specific prior written permission. 15*805a1ce9Schristos * 16*805a1ce9Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17*805a1ce9Schristos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18*805a1ce9Schristos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19*805a1ce9Schristos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20*805a1ce9Schristos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21*805a1ce9Schristos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22*805a1ce9Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23*805a1ce9Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24*805a1ce9Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25*805a1ce9Schristos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26*805a1ce9Schristos */ 27*805a1ce9Schristos #ifndef KQUEUE_INTERNAL_H_INCLUDED_ 28*805a1ce9Schristos #define KQUEUE_INTERNAL_H_INCLUDED_ 29*805a1ce9Schristos 30*805a1ce9Schristos /** Notification function, used to tell an event base to wake up from another 31*805a1ce9Schristos * thread. Only works when event_kq_add_notify_event_() has previously been 32*805a1ce9Schristos * called successfully on that base. */ 33*805a1ce9Schristos int event_kq_notify_base_(struct event_base *base); 34*805a1ce9Schristos 35*805a1ce9Schristos /** Prepare a kqueue-using event base to receive notifications via an internal 36*805a1ce9Schristos * EVFILT_USER event. Return 0 on sucess, -1 on failure. 37*805a1ce9Schristos */ 38*805a1ce9Schristos int event_kq_add_notify_event_(struct event_base *base); 39*805a1ce9Schristos 40*805a1ce9Schristos #endif 41