Re: poll() in 2.6 and beyond

From: Roland Dreier
Date: Tue Mar 02 2004 - 16:02:53 EST


Richard> I'm talking about the driver! When a open fd called
Richard> poll() or select(), in user-mode code, the driver's
Richard> poll() was called, and the driver's poll() would call
Richard> poll_wait(). Poll_wait() used to NOT return until the
Richard> driver executed wake_up_interruptible() on that
Richard> wait-queue. When poll_wait() returned, the driver would
Richard> return to the caller with the new poll- status.

I don't think so. Even in kernel 2.4, poll_wait() just calls
__pollwait(). I don't see anything in __pollwait() that sleeps.
Think about it. How would the kernel handle userspace calling poll()
with more than one file descriptor if each individual driver slept?

I'll repeat my earlier suggestion. Read the description of "poll and
select" in LDD:
<http://www.xml.com/ldd/chapter/book/ch05.html#t3>

If you refuse to understand the documented interface, I don't think
anyone can help you.

- 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/