On Thu, Mar 25, 2010 at 04:53:02PM +0300, Zajcev Evgeny <[email protected]>
wrote:
> at the for time `polls' looks like this:
> {fd = 3, events = 1, revents = 0}
> {fd = 6, events = 5, revents = 4}
> {fd = 775043377, events = 13873, revents = 11832} (**)
> ...
> i don't know `res' value, but i suppose it was 2.
The value of res would be helpful. If res is two, then this is a kernel
bug that you should report (or maybe upgrade to a fixed version), not a
bug in libev.
> of course this situation is incorrect for the code above, because `p'
> will eventually point to (**) uninitialized record (but present in
> memory).
Only if poll returns an illegal return code.
> So, i think `res' must decrease in conjunction with `p' increasement,
> like this:
Then we would miss events, as not all poll structs have events, and we
would only look at the first "res", and not all with nonzero result code.
> for (p = polls; res--; ++p)
> what do you think?
All depends on what res is. If res is two, then this is clearly a kernel
bug.
> PS: i dont get any problem running current libev implementation under
> linux and in most situations under freebsd
Probably because linux poll returns 1 in the above situation.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [email protected]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev