DENX . Training2 . LddPollAndSelect

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);

----- Revision r1.5 - 01 Nov 2008 - 14:09 - MarkusKlotzbuecher
Copyright © 2002-2020 by DENX Software Engineering