Lines Matching refs:kqueue

101 MALLOC_DEFINE(M_KQUEUE, "kqueue", "memory for kqueue system");
105 static inline void kqlock(struct kqueue *kq);
106 static inline void kqunlock(struct kqueue *kq);
108 static int kqlock2knoteuse(struct kqueue *kq, struct knote *kn);
109 static int kqlock2knoteusewait(struct kqueue *kq, struct knote *kn);
110 static int kqlock2knotedrop(struct kqueue *kq, struct knote *kn);
111 static int knoteuse2kqlock(struct kqueue *kq, struct knote *kn);
113 static void kqueue_wakeup(struct kqueue *kq, int closed);
144 static int kevent_callback(struct kqueue *kq, struct kevent64_s *kevp, void *data);
145 static void kevent_continue(struct kqueue *kq, void *data, int error);
147 static int kqueue_process(struct kqueue *kq, kevent_callback_t callback,
149 static int kqueue_begin_processing(struct kqueue *kq);
150 static void kqueue_end_processing(struct kqueue *kq);
288 * kqueue/note lock attributes and implementations
292 * the knote "inuse" count and status use the kqueue lock.
299 kqlock(struct kqueue *kq)
305 kqunlock(struct kqueue *kq)
321 kqlock2knoteuse(struct kqueue *kq, struct knote *kn)
342 kqlock2knoteusewait(struct kqueue *kq, struct knote *kn)
364 * still alive - but the kqueue lock is taken
368 knoteuse2kqlock(struct kqueue *kq, struct knote *kn)
398 kqlock2knotedrop(struct kqueue *kq, struct knote *kn)
423 struct kqueue *kq = kn->kn_kq;
453 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
464 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
771 struct kqueue *kq = kn->kn_kq;
786 struct kqueue *kq = kn->kn_kq;
1054 struct kqueue *
1058 struct kqueue *kq;
1060 MALLOC_ZONE(kq, struct kqueue *, sizeof(struct kqueue), M_KQUEUE, M_WAITOK);
1066 bzero(kq, sizeof(struct kqueue));
1072 FREE_ZONE(kq, sizeof(struct kqueue), M_KQUEUE);
1088 * kqueue_dealloc - detach all knotes from a kqueue and free it
1091 * this kqueue. If we find one, we try to drop it. But
1095 * not contain any more references to this kqueue (either
1098 * Assumes no new events are being added to the kqueue.
1102 kqueue_dealloc(struct kqueue *kq)
1153 * before freeing the wait queue set for this kqueue,
1159 FREE_ZONE(kq, sizeof(struct kqueue), M_KQUEUE);
1163 kqueue(struct proc *p, __unused struct kqueue_args *uap, int32_t *retval)
1165 struct kqueue *kq;
1287 kevent_continue(__unused struct kqueue *kq, void *data, int error)
1356 struct kqueue *kq;
1454 * caller holds a reference on the kqueue
1458 kevent_callback(__unused struct kqueue *kq, struct kevent64_s *kevp,
1508 * kevent_register - add a new event to a kqueue
1511 * the kqueue via a knote data structure.
1518 * caller holds a reference on the kqueue
1522 kevent_register(struct kqueue *kq, struct kevent64_s *kev, __unused struct proc *ctxp)
1650 /* existing knote - get kqueue lock */
1694 /* kqueue, proc_fdlock both unlocked */
1737 * caller holds a reference on the kqueue.
1738 * kqueue locked on entry and exit - but may be dropped
1747 struct kqueue *kq = kn->kn_kq;
1879 * Called with kqueue locked and returns the same way,
1883 kqueue_begin_processing(struct kqueue *kq)
1905 * Called with kqueue lock held.
1908 kqueue_end_processing(struct kqueue *kq)
1918 * kqueue_process - process the triggered events in a kqueue
1927 * caller holds a reference on the kqueue.
1928 * kqueue locked on entry and exit - but may be dropped
1929 * kqueue list locked (held for duration of call)
1933 kqueue_process(struct kqueue *kq,
1976 * With the kqueue still locked, move any knotes
2000 struct kqueue *kq = (struct kqueue *)data;
2037 * kqueue_scan - scan and wait for events in a kqueue
2039 * Process the triggered events in a kqueue.
2051 kqueue_scan(struct kqueue *kq,
2176 struct kqueue *kq = (struct kqueue *)fp->f_data;
2189 * the kqueue onto the wait queue set for the select(). Normally we
2191 * selinfo structure and we need to use the main one for the kqueue to
2262 struct kqueue *kq = (struct kqueue *)fg->fg_data;
2271 * The callers has taken a use-count reference on this kqueue and will donate it
2272 * to the kqueue we are being added to. This keeps the kqueue from closing until
2278 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
2279 struct kqueue *parentkq = kn->kn_kq;
2289 * ceiling protocol. When a kqueue is inserted into another,
2291 * into another kqueue at a lower level than the potenial
2328 struct kqueue *kq = (struct kqueue *)fp->f_fglob->fg_data;
2340 struct kqueue *kq = (struct kqueue *)fp->f_data;
2367 * Called with the kqueue locked
2370 kqueue_wakeup(struct kqueue *kq, int closed)
2404 struct kqueue *kq = kn->kn_kq;
2446 * For a given knote, link a provided wait queue directly with the kqueue.
2451 * kqueue and knote references are held by caller.
2458 struct kqueue *kq = kn->kn_kq;
2471 * Unlink the provided wait queue from the kqueue associated with a knote.
2475 * ignore any failures to unlink and just remove it from the kqueue list.
2482 struct kqueue *kq = kn->kn_kq;
2511 struct kqueue *kq = kn->kn_kq;
2594 struct kqueue *kq = kn->kn_kq;
2622 /* called with kqueue lock held */
2626 struct kqueue *kq = kn->kn_kq;
2637 /* called with kqueue lock held */
2645 /* called with kqueue lock held */
2652 struct kqueue *kq = kn->kn_kq;
2660 /* called with kqueue lock held */
2664 struct kqueue *kq = kn->kn_kq;
2684 kq_lck_grp = lck_grp_alloc_init("kqueue", kq_lck_grp_attr);
2986 fill_kqueueinfo(struct kqueue *kq, struct kqueue_info * kinfo)