MCPcopy Create free account
hub / github.com/F-Stack/f-stack / knlist_add

Function knlist_add

freebsd/kern/kern_event.c:2301–2319  ·  view source on GitHub ↗

* add a knote to a knlist */

Source from the content-addressed store, hash-verified

2299 * add a knote to a knlist
2300 */
2301void
2302knlist_add(struct knlist *knl, struct knote *kn, int islocked)
2303{
2304
2305 KNL_ASSERT_LOCK(knl, islocked);
2306 KQ_NOTOWNED(kn->kn_kq);
2307 KASSERT(kn_in_flux(kn), ("knote %p not in flux", kn));
2308 KASSERT((kn->kn_status & KN_DETACHED) != 0,
2309 ("knote %p was not detached", kn));
2310 if (!islocked)
2311 knl->kl_lock(knl->kl_lockarg);
2312 SLIST_INSERT_HEAD(&knl->kl_list, kn, kn_selnext);
2313 if (!islocked)
2314 knl->kl_unlock(knl->kl_lockarg);
2315 KQ_LOCK(kn->kn_kq);
2316 kn->kn_knlist = knl;
2317 kn->kn_status &= ~KN_DETACHED;
2318 KQ_UNLOCK(kn->kn_kq);
2319}
2320
2321static void
2322knlist_remove_kq(struct knlist *knl, struct knote *kn, int knlislocked,

Callers 15

audit_pipe_kqfilterFunction · 0.85
ti_pruss_irq_kqfilterFunction · 0.85
ptsdev_kqfilterFunction · 0.85
logkqfilterFunction · 0.85
ttydev_kqfilterFunction · 0.85
kqueue_kqfilterFunction · 0.85
filt_procattachFunction · 0.85
mqf_kqfilterFunction · 0.85
filt_sigattachFunction · 0.85
eventfd_kqfilterFunction · 0.85
pipe_kqfilterFunction · 0.85
devkqfilterFunction · 0.85

Calls 1

kn_in_fluxFunction · 0.85

Tested by

no test coverage detected