• Home
  • Raw
  • Download

Lines Matching refs:kqop

69 struct kqop {  struct
79 static void kqop_free(struct kqop *kqop); argument
115 struct kqop *kqueueop = NULL; in kq_init()
117 if (!(kqueueop = mm_calloc(1, sizeof(struct kqop)))) in kq_init()
203 struct kqop *kqop) in kq_build_changes_list() argument
211 if (n_changes >= kqop->changes_size - 1) { in kq_build_changes_list()
212 int newsize = kqop->changes_size * 2; in kq_build_changes_list()
215 newchanges = mm_realloc(kqop->changes, in kq_build_changes_list()
221 kqop->changes = newchanges; in kq_build_changes_list()
222 kqop->changes_size = newsize; in kq_build_changes_list()
225 out_ch = &kqop->changes[n_changes++]; in kq_build_changes_list()
230 out_ch = &kqop->changes[n_changes++]; in kq_build_changes_list()
239 kq_grow_events(struct kqop *kqop, size_t new_size) in kq_grow_events() argument
243 newresult = mm_realloc(kqop->events, in kq_grow_events()
247 kqop->events = newresult; in kq_grow_events()
248 kqop->events_size = new_size; in kq_grow_events()
258 struct kqop *kqop = base->evbase; in kq_dispatch() local
259 struct kevent *events = kqop->events; in kq_dispatch()
270 EVUTIL_ASSERT(kqop->changes); in kq_dispatch()
271 n_changes = kq_build_changes_list(&base->changelist, kqop); in kq_dispatch()
279 changes = kqop->changes; in kq_dispatch()
280 kqop->changes = NULL; in kq_dispatch()
291 if (kqop->events_size < n_changes) { in kq_dispatch()
292 int new_size = kqop->events_size; in kq_dispatch()
297 kq_grow_events(kqop, new_size); in kq_dispatch()
298 events = kqop->events; in kq_dispatch()
303 res = kevent(kqop->kq, changes, n_changes, in kq_dispatch()
304 events, kqop->events_size, ts_p); in kq_dispatch()
308 EVUTIL_ASSERT(kqop->changes == NULL); in kq_dispatch()
309 kqop->changes = changes; in kq_dispatch()
389 if (res == kqop->events_size) { in kq_dispatch()
392 kq_grow_events(kqop, kqop->events_size * 2); in kq_dispatch()
399 kqop_free(struct kqop *kqop) in kqop_free() argument
401 if (kqop->changes) in kqop_free()
402 mm_free(kqop->changes); in kqop_free()
403 if (kqop->events) in kqop_free()
404 mm_free(kqop->events); in kqop_free()
405 if (kqop->kq >= 0 && kqop->pid == getpid()) in kqop_free()
406 close(kqop->kq); in kqop_free()
407 memset(kqop, 0, sizeof(struct kqop)); in kqop_free()
408 mm_free(kqop); in kqop_free()
414 struct kqop *kqop = base->evbase; in kq_dealloc() local
416 kqop_free(kqop); in kq_dealloc()
423 struct kqop *kqop = base->evbase; in kq_sig_add() local
438 if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) in kq_sig_add()
452 struct kqop *kqop = base->evbase; in kq_sig_del() local
468 if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) in kq_sig_del()