In this recipe, we will find out how to ask to the kernel to check for us when our driver has new data to be read (or it's willing to accept new data to be written), and then to wake up the reading (or writing) process without the risk of being blocked on the I/O operation.
Waiting for I/O operations with poll() and select()
Getting ready
To test our implementation, we can still use the chrdev_irq.c driver as before; this is because we can use the new data event simulated by the kernel timer.
How to do it...
Let's see how to do it by following these steps:
- First...