FreeBSD/sys/dev/hyperv/utilities/hv_kvp.c
/*
 * hv_kvp_daemon poll invokes this function to check if data is available
 * for daemon to read.
 */
hv_kvp_daemon poll invokes this function to check if data is available
for daemon to read.
hv_kvp_daemon poll invokes this function to check if data is available for daemon to read .
static int
hv_kvp_dev_daemon_poll(struct cdev *dev, int events, struct thread *td)
{
	int revents = 0;
	hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1;
	mtx_lock(&sc->pending_mutex);
	if (sc->daemon_busy == true)
		revents = POLLIN;
	else
		selrecord(td, &sc->hv_kvp_selinfo);
	mtx_unlock(&sc->pending_mutex);
	return (revents);
}
static int hv_kvp_dev_daemon_poll ( struct cdev * dev , int events , struct thread * td ) { int revents = 0 ; hv_kvp_sc * sc = ( hv_kvp_sc * ) dev -> si_drv1 ; mtx_lock ( & sc -> pending_mutex ) ; if ( sc -> daemon_busy == true ) revents = POLLIN ; else selrecord ( td , & sc -> hv_kvp_selinfo ) ; mtx_unlock ( & sc -> pending_mutex ) ; return ( revents ) ; }
hv_kvp_daemon poll invokes this function to check if data is available
 for daemon to read.
hv_kvp_daemon poll invokes this function to check if data is available for daemon to read .
/*
	 * We check global flag daemon_busy for the data availiability for
	 * userland to read. Deamon_busy is set to true before driver has data
	 * for daemon to read. It is set to false after daemon sends
	 * then response back to driver.
	 */