(First, sorry if anybody got a response earlier; my net connection
 dropped out in the middle of sending the message and I'm pretty sure
 the mail did not make it through.)

On Mon, Apr 20, 2009 at 08:31:44AM -0700, patrick keshishian wrote:
> I've not used kqueue but first (quick) glance at the man page
> indicates that you look at the return value from kevent() and then
> iterate over that value (if not -1) and process each eventlist.

Oops, yeah that's a stupid mistake, kevent() would definitely get
called too many times.

> > ?? ?? ?? ??changelist[i].ident = i;
> >
> > Pretty sure this line is your problem.
> 
> the man page agrees with above statement. Read section about EVFILT_READ 
> filter.

Ah, that is indeed the problem.  I don't know why I thought that I
should be shoving the file descriptor into the user field, especially
since the manual page clearly says otherwise.  Must have somehow got
it into my head that ident was supposed to be a unique changelist or
event identifier.  With this fixed everything is working.

Thanks much to both you and Art for taking the time to look over this,
I appreciate it.

-- 
Taylor Christopher Venable
http://real.metasyntax.net:2357/

Reply via email to