libev and sockets question

Marc Lehmann schmorp at
Fri Feb 13 17:46:15 CET 2009

On Fri, Feb 13, 2009 at 05:38:26PM +0200, Leon <ljbrits at> wrote:
> Only SELECT and POLL worked and KQUEUE not! Therefore I looked at the
> code (inherited) again and found a pointer error where the flags/events
> on which a watcher must trigger was set. I Fixed it and now everything
> is working as well as KQUEUE.
> Sorry for the trouble and thanks for a great lib. I still wander why
> POLL worked?

Without the code, we will never know. But unfortunately, when kernel
designers design a new event polling interface, they often think it
prudent to give it different behaviour than select or poll (well, at least
event ports, kqueue and epoll are all more or less not behaving the same
as select or poll, and much of libev (and it's documentation) is trying to
work around those differences).

It would indeed be nice if kernel people just gave us a faster select/poll.
kqueue is very near to this, actually.

So the change in behaviour you saw might have been pure chance, or a
subtle difference in how the backends work, for example, some backends
might generate spurious events, others not.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list