Writing Device Drivers

Polling

These interfaces support the poll(2) system call, which provides a mechanism for application programs to "poll" character-oriented devices, inquiring about their readiness to perform certain I/O operations. See the poll(2) manual page for details.

int nochpoll(dev_t dev, short events, int anyyet,  	
			short *reventsp, struct pollhead **pollhdrp);

Use nochpoll(9F) as the chpoll entry in the cb_ops(9S) structure if the driver does not support polling.

void pollwakeup(struct pollhead *php, short event);

If the driver does implement a chpoll(9E) entry point to support polling, it should call pollwakeup(9F) whenever the event occurs.