Re: poll() in 2.6 and beyond

From: Roland Dreier
Date: Tue Mar 02 2004 - 15:07:57 EST


Richard> Poll in 2.6.0; when a driver routine calls poll_wait() it
Richard> returns <<immediately>> to somewhere in the kernel, then
Richard> waits for my wake_up_interuptible(), before returning
Richard> control to a user sleeping in poll(). This means that the
Richard> user gets the wrong poll return value! It doesn't get the
Richard> value it was given as a result of the interrupt, but the
Richard> value that existed (0) before the interrupt occurred.

Nothing has changed in 2.6 that I know of. poll_wait() always
returned immediately to the driver. The driver's poll method is
supposed to call poll_wait() on the wait queues that indicate a change
in poll status, and then return with the current status.

Read the description of "poll and select" in LDD:
<http://www.xml.com/ldd/chapter/book/ch05.html#t3>

- Roland

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/