In the last episode (Dec 16), Sen C. Farley said:
> I may have missed it in the man page, but I am unable to find a way
> to determine how many kevents are currently registered within a
> kqueue.  If there is no method for a count, how about a way to find
> if a kqueue is empty or not.  Besides tracking what events are still
> within a kqueue, this would make for an easier way to write an event
> loop.  Currently, calling kevent() on an empty kqueue will still
> block.

I don't think there's a way currently.  What I did in my local tree is
modify kern_kevent so that if the magic number -1 is passed in as
nchanges, it will return the entire queued event list back to the
caller in *eventlist, and return the number of events as the
returncode.  Very useful for debugging kqueue-using programs where you
want to compare what you think you're waiting for, and what the kernel
thinks you're waiting for :)

-- 
        Dan Nelson
        [EMAIL PROTECTED]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to