Skip to main content.

5.3.7. poll and select

View from Userspace:

View from Kernelspace:

API: poll

header and poll operation

#include <linux/poll.h>
unsigned int poll(struct file *filp, poll_table *wait);

step 1: add waitqueues

void poll_wait(struct file*, wait_queue_head_t *, poll_table *);

step 2: return appropriate status (more in asm/poll.h)

/* readable */
return (POLLIN | POLLRDNORM);

/* writeable */
return (POLLOUT | POLLWRNORM);

5.3.6. Non-Blocking IO 1. Denx Training Topics 5.3.8. Memory mapping
Prev Home Next