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

Function devpoll

freebsd/kern/subr_bus.c:555–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555static int
556devpoll(struct cdev *dev, int events, struct thread *td)
557{
558 int revents = 0;
559
560 mtx_lock(&devsoftc.mtx);
561 if (events & (POLLIN | POLLRDNORM)) {
562 if (!STAILQ_EMPTY(&devsoftc.devq))
563 revents = events & (POLLIN | POLLRDNORM);
564 else
565 selrecord(td, &devsoftc.sel);
566 }
567 mtx_unlock(&devsoftc.mtx);
568
569 return (revents);
570}
571
572static int
573devkqfilter(struct cdev *dev, struct knote *kn)

Callers

nothing calls this directly

Calls 3

selrecordFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected