Number of kevents registered in kqueue

Seán C. Farley sean-freebsd at farley.org
Fri Dec 16 14:09:20 PST 2005


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.

Also, I recommend that the man page mention that a kqueue may be
close(2)'d.  The only reference that it can be is that the manual page
says the kqueue() call returns a descriptor.

Seán
-- 
sean-freebsd at farley.org


More information about the freebsd-hackers mailing list