Is it OK to poll() a device file descriptor

Is it OK to poll() a device file descriptor

Elazar Leibovich elazarl at gmail.com
Tue Jun 18 21:14:59 IDT 2013


Damn I missed that.

To my defense, this bug should be also mentioned in the POLLNVAL section.
As it stands now, it looks like the only reason for POLLNVAL is a closed
file descriptor.

Sorry and thanks.


On Tue, Jun 18, 2013 at 6:09 PM, Oleg Goldshmidt <pub at goldshmidt.org> wrote:

> Elazar Leibovich <elazarl at gmail.com> writes:
>
> > Try to open /dev/null, and then to poll the file descriptor. Neither
> > in the man page nor in the standard I see anything preventing you to
> > poll on /dev/null, yet, it does not work on Mac OS X. You get a
> > POLLNVAL.
>
> From
> http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/poll.2.html
> :
>
> BUGS
>      The poll() system call currently does not support devices.
>
> Your code works fine on Linux, but I suppose you know that.
>
> --
> Oleg Goldshmidt | pub at goldshmidt.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20130618/1f21fce9/attachment.html>


More information about the Linux-il mailing list