Lines Matching refs:kqueue

106 MALLOC_DEFINE(M_KQUEUE, "kqueue", "memory for kqueue system");
110 static inline void kqlock(struct kqueue *kq);
111 static inline void kqunlock(struct kqueue *kq);
113 static int kqlock2knoteuse(struct kqueue *kq, struct knote *kn);
114 static int kqlock2knoteusewait(struct kqueue *kq, struct knote *kn);
115 static int kqlock2knotedrop(struct kqueue *kq, struct knote *kn);
116 static int knoteuse2kqlock(struct kqueue *kq, struct knote *kn);
118 static void kqueue_wakeup(struct kqueue *kq, int closed);
154 static int kevent_callback(struct kqueue *kq, struct kevent64_s *kevp,
156 static void kevent_continue(struct kqueue *kq, void *data, int error);
158 static int kqueue_process(struct kqueue *kq, kevent_callback_t callback,
160 static int kqueue_begin_processing(struct kqueue *kq);
161 static void kqueue_end_processing(struct kqueue *kq);
306 * kqueue/note lock attributes and implementations
310 * the knote "inuse" count and status use the kqueue lock.
317 kqlock(struct kqueue *kq)
323 kqunlock(struct kqueue *kq)
338 kqlock2knoteuse(struct kqueue *kq, struct knote *kn)
358 kqlock2knoteusewait(struct kqueue *kq, struct knote *kn)
380 * still alive - but the kqueue lock is taken
384 knoteuse2kqlock(struct kqueue *kq, struct knote *kn)
415 kqlock2knotedrop(struct kqueue *kq, struct knote *kn)
441 struct kqueue *kq = kn->kn_kq;
470 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
481 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
831 struct kqueue *kq = kn->kn_kq;
846 struct kqueue *kq = kn->kn_kq;
1155 struct kqueue *
1159 struct kqueue *kq;
1161 MALLOC_ZONE(kq, struct kqueue *, sizeof (struct kqueue), M_KQUEUE,
1169 bzero(kq, sizeof (struct kqueue));
1175 FREE_ZONE(kq, sizeof (struct kqueue), M_KQUEUE);
1190 * kqueue_dealloc - detach all knotes from a kqueue and free it
1193 * this kqueue. If we find one, we try to drop it. But
1197 * not contain any more references to this kqueue (either
1200 * Assumes no new events are being added to the kqueue.
1204 kqueue_dealloc(struct kqueue *kq)
1255 * before freeing the wait queue set for this kqueue,
1261 FREE_ZONE(kq, sizeof (struct kqueue), M_KQUEUE);
1267 struct kqueue *kq;
1298 kqueue(struct proc *p, __unused struct kqueue_args *uap, int32_t *retval)
1398 kevent_continue(__unused struct kqueue *kq, void *data, int error)
1467 struct kqueue *kq;
1565 * caller holds a reference on the kqueue
1568 kevent_callback(__unused struct kqueue *kq, struct kevent64_s *kevp,
1620 * kevent_register - add a new event to a kqueue
1623 * the kqueue via a knote data structure.
1630 * caller holds a reference on the kqueue
1634 kevent_register(struct kqueue *kq, struct kevent64_s *kev,
1763 /* existing knote - get kqueue lock */
1807 /* kqueue, proc_fdlock both unlocked */
1850 * caller holds a reference on the kqueue.
1851 * kqueue locked on entry and exit - but may be dropped
1860 struct kqueue *kq = kn->kn_kq;
2007 * Called with kqueue locked and returns the same way,
2011 kqueue_begin_processing(struct kqueue *kq)
2034 * Called with kqueue lock held.
2037 kqueue_end_processing(struct kqueue *kq)
2048 * kqueue_process - process the triggered events in a kqueue
2057 * caller holds a reference on the kqueue.
2058 * kqueue locked on entry and exit - but may be dropped
2059 * kqueue list locked (held for duration of call)
2063 kqueue_process(struct kqueue *kq,
2106 * With the kqueue still locked, move any knotes
2130 struct kqueue *kq = (struct kqueue *)data;
2169 * kqueue_scan - scan and wait for events in a kqueue
2171 * Process the triggered events in a kqueue.
2183 kqueue_scan(struct kqueue *kq,
2311 struct kqueue *kq = (struct kqueue *)fp->f_data;
2324 * the kqueue onto the wait queue set for the select(). Normally we
2326 * selinfo structure and we need to use the main one for the kqueue to
2397 struct kqueue *kq = (struct kqueue *)fg->fg_data;
2406 * The callers has taken a use-count reference on this kqueue and will donate it
2407 * to the kqueue we are being added to. This keeps the kqueue from closing until
2413 struct kqueue *kq = (struct kqueue *)kn->kn_fp->f_data;
2414 struct kqueue *parentkq = kn->kn_kq;
2424 * ceiling protocol. When a kqueue is inserted into another,
2426 * into another kqueue at a lower level than the potenial
2463 struct kqueue *kq = (struct kqueue *)fp->f_fglob->fg_data;
2475 struct kqueue *kq = (struct kqueue *)fp->f_data;
2502 * Called with the kqueue locked
2505 kqueue_wakeup(struct kqueue *kq, int closed)
2539 struct kqueue *kq = kn->kn_kq;
2581 * For a given knote, link a provided wait queue directly with the kqueue.
2586 * kqueue and knote references are held by caller.
2593 struct kqueue *kq = kn->kn_kq;
2606 * Unlink the provided wait queue from the kqueue associated with a knote.
2610 * ignore any failures to unlink and just remove it from the kqueue list.
2617 struct kqueue *kq = kn->kn_kq;
2646 struct kqueue *kq = kn->kn_kq;
2730 struct kqueue *kq = kn->kn_kq;
2759 /* called with kqueue lock held */
2763 struct kqueue *kq = kn->kn_kq;
2774 /* called with kqueue lock held */
2782 /* called with kqueue lock held */
2789 struct kqueue *kq = kn->kn_kq;
2797 /* called with kqueue lock held */
2801 struct kqueue *kq = kn->kn_kq;
2822 kq_lck_grp = lck_grp_alloc_init("kqueue", kq_lck_grp_attr);
3308 fill_kqueueinfo(struct kqueue *kq, struct kqueue_info * kinfo)