34#include <sys/_types.h>
37#define EVFILT_READ (-1)
38#define EVFILT_WRITE (-2)
39#define EVFILT_AIO (-3)
40#define EVFILT_VNODE (-4)
41#define EVFILT_PROC (-5)
42#define EVFILT_SIGNAL (-6)
43#define EVFILT_TIMER (-7)
44#define EVFILT_PROCDESC (-8)
46#define EVFILT_LIO (-10)
47#define EVFILT_USER (-11)
48#define EVFILT_SENDFILE (-12)
49#define EVFILT_EMPTY (-13)
50#define EVFILT_SYSCOUNT 13
52#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53#define EV_SET(kevp_, a, b, c, d, e, f) do { \
54 *(kevp_) = (struct kevent){ \
68#define EV_SET(kevp_, a, b, c, d, e, f) do { \
69 struct kevent *kevp = (kevp_); \
70 (kevp)->ident = (a); \
71 (kevp)->filter = (b); \
72 (kevp)->flags = (c); \
73 (kevp)->fflags = (d); \
75 (kevp)->udata = (f); \
93#if defined(_WANT_FREEBSD11_KEVENT)
95struct kevent_freebsd11 {
105#if defined(_WANT_KEVENT32) || (defined(_KERNEL) && defined(__LP64__))
114 int32_t data1, data2;
122#ifdef _WANT_FREEBSD11_KEVENT
123struct kevent32_freebsd11 {
136#define EV_DELETE 0x0002
137#define EV_ENABLE 0x0004
138#define EV_DISABLE 0x0008
139#define EV_FORCEONESHOT 0x0100
142#define EV_ONESHOT 0x0010
143#define EV_CLEAR 0x0020
144#define EV_RECEIPT 0x0040
145#define EV_DISPATCH 0x0080
147#define EV_SYSFLAGS 0xF000
148#define EV_DROP 0x1000
149#define EV_FLAG1 0x2000
150#define EV_FLAG2 0x4000
154#define EV_ERROR 0x4000
165#define NOTE_FFNOP 0x00000000
166#define NOTE_FFAND 0x40000000
167#define NOTE_FFOR 0x80000000
168#define NOTE_FFCOPY 0xc0000000
169#define NOTE_FFCTRLMASK 0xc0000000
170#define NOTE_FFLAGSMASK 0x00ffffff
172#define NOTE_TRIGGER 0x01000000
178#define NOTE_LOWAT 0x0001
179#define NOTE_FILE_POLL 0x0002
184#define NOTE_DELETE 0x0001
185#define NOTE_WRITE 0x0002
186#define NOTE_EXTEND 0x0004
187#define NOTE_ATTRIB 0x0008
188#define NOTE_LINK 0x0010
189#define NOTE_RENAME 0x0020
190#define NOTE_REVOKE 0x0040
191#define NOTE_OPEN 0x0080
192#define NOTE_CLOSE 0x0100
194#define NOTE_CLOSE_WRITE 0x0200
196#define NOTE_READ 0x0400
201#define NOTE_EXIT 0x80000000
202#define NOTE_FORK 0x40000000
203#define NOTE_EXEC 0x20000000
204#define NOTE_PCTRLMASK 0xf0000000
205#define NOTE_PDATAMASK 0x000fffff
208#define NOTE_TRACK 0x00000001
209#define NOTE_TRACKERR 0x00000002
210#define NOTE_CHILD 0x00000004
213#define NOTE_SECONDS 0x00000001
214#define NOTE_MSECONDS 0x00000002
215#define NOTE_USECONDS 0x00000004
216#define NOTE_NSECONDS 0x00000008
217#define NOTE_ABSTIME 0x00000010
220SLIST_HEAD(klist, knote);
222TAILQ_HEAD(kqlist, kqueue);
224 struct klist kl_list;
225 void (*kl_lock)(
void *);
226 void (*kl_unlock)(
void *);
227 void (*kl_assert_locked)(
void *);
228 void (*kl_assert_unlocked)(
void *);
239#define KNF_LISTLOCKED 0x0001
240#define KNF_NOKQLOCK 0x0002
242#define KNOTE(list, hint, flags) knote(list, hint, flags)
243#define KNOTE_LOCKED(list, hint) knote(list, hint, KNF_LISTLOCKED)
244#define KNOTE_UNLOCKED(list, hint) knote(list, hint, 0)
246#define KNLIST_EMPTY(list) SLIST_EMPTY(&(list)->kl_list)
252#define NOTE_SIGNAL 0x08000000
261#define EVENT_REGISTER 1
262#define EVENT_PROCESS 2
266 int (*f_attach)(
struct knote *kn);
267 void (*f_detach)(
struct knote *kn);
268 int (*f_event)(
struct knote *kn,
long hint);
269 void (*f_touch)(
struct knote *kn,
struct kevent *kev, u_long type);
282 SLIST_ENTRY(knote) kn_link;
283 SLIST_ENTRY(knote) kn_selnext;
285 TAILQ_ENTRY(knote) kn_tqe;
286 struct kqueue *kn_kq;
291#define KN_ACTIVE 0x01
292#define KN_QUEUED 0x02
293#define KN_DISABLED 0x04
294#define KN_DETACHED 0x08
295#define KN_MARKER 0x20
296#define KN_KQUEUE 0x40
297#define KN_HASKQLOCK 0x80
305 struct kaiocb *p_aio;
306 struct aioliojob *p_lio;
309 struct filterops *kn_fop;
311#define kn_id kn_kevent.ident
312#define kn_filter kn_kevent.filter
313#define kn_flags kn_kevent.flags
314#define kn_fflags kn_kevent.fflags
315#define kn_data kn_kevent.data
316#define kn_fp kn_ptr.p_fp
318struct kevent_copyops {
320 int (*k_copyout)(
void *arg,
struct kevent *kevp,
int count);
321 int (*k_copyin)(
void *arg,
struct kevent *kevp,
int count);
331void knote(
struct knlist *list,
long hint,
int lockflags);
332void knote_fork(
struct knlist *list,
int pid);
333struct knlist *knlist_alloc(
struct mtx *lock);
334void knlist_detach(
struct knlist *knl);
335void knlist_add(
struct knlist *knl,
struct knote *kn,
int islocked);
336void knlist_remove(
struct knlist *knl,
struct knote *kn,
int islocked);
337int knlist_empty(
struct knlist *knl);
338void knlist_init(
struct knlist *knl,
void *lock,
void (*kl_lock)(
void *),
339 void (*kl_unlock)(
void *),
void (*kl_assert_locked)(
void *),
340 void (*kl_assert_unlocked)(
void *));
341void knlist_init_mtx(
struct knlist *knl,
struct mtx *lock);
342void knlist_init_rw_reader(
struct knlist *knl,
struct rwlock *lock);
343void knlist_destroy(
struct knlist *knl);
344void knlist_cleardel(
struct knlist *knl,
struct thread *td,
345 int islocked,
int killkn);
346#define knlist_clear(knl, islocked) \
347 knlist_cleardel((knl), NULL, (islocked), 0)
348#define knlist_delete(knl, td, islocked) \
349 knlist_cleardel((knl), (td), (islocked), 1)
350void knote_fdclose(
struct thread *
p,
int fd);
351int kqfd_register(
int fd,
struct kevent *kev,
struct thread *
p,
353int kqueue_add_filteropts(
int filt,
struct filterops *filtops);
354int kqueue_del_filteropts(
int filt);
358#include <sys/cdefs.h>
363int kevent(
int kq,
const struct kevent *changelist,
int nchanges,
364 struct kevent *eventlist,
int nevents,
365 const struct timespec *timeout);
Definition: mongoose.c:448
unsigned p
Definition: tte.h:17