Svante Signell, le Thu 18 Oct 2012 14:33:53 +0200, a écrit :
> with errors specified by:
> 
> ERRORS

POSIX does not document all errors that may happen, it's completely
valid to fail for other errors.

> POLLNVAL
>         The specified fd value is invalid. This flag is only valid in
>         the revents member; it shall ignored in the events member.
> 
> Specifically, my interpretation of POLLNVAL is that it should be
> reported for each invalid fd given as input.

Ah.  You should have pointed to that from the start :)

> And my interpretation of POLLERR is that it should be reported to
> _every_ fd (device or stream) given as input. 
> 
> And for these cases the return code should be the number of good fds as
> well as bad fds, since the revents member is nonzero. (I did not come
> that far in my changes by then, but it could easily be done with today's
> knowledge! There are also other case to take care of like: POLLWRBAND
> etc)

Indeed. That's also what was completely missing in your previous
description. It's indeed a bug. And it has to be fixed in poll only, not
in select.

Samuel

Reply via email to