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

Function logpoll

freebsd/kern/subr_log.c:182–196  ·  view source on GitHub ↗

ARGSUSED*/

Source from the content-addressed store, hash-verified

180
181/*ARGSUSED*/
182static int
183logpoll(struct cdev *dev, int events, struct thread *td)
184{
185 int revents = 0;
186
187 if (events & (POLLIN | POLLRDNORM)) {
188 mtx_lock(&msgbuf_lock);
189 if (msgbuf_getcount(msgbufp) > 0)
190 revents |= events & (POLLIN | POLLRDNORM);
191 else
192 selrecord(td, &logsoftc.sc_selp);
193 mtx_unlock(&msgbuf_lock);
194 }
195 return (revents);
196}
197
198static int
199logkqfilter(struct cdev *dev, struct knote *kn)

Callers

nothing calls this directly

Calls 4

msgbuf_getcountFunction · 0.85
selrecordFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected