kqueue oddity

Václav Haisman V.Haisman at sh.cvut.cz
Sat Apr 1 14:51:22 UTC 2006


Hi,
I have a little problem with kqueue/kevent. I am getting somewhat
strange events from kevent(). The struct kevent's contents looks like this:

kevent {.ident =  1, .filter = 0xfffffffe, .flags = 0x0001, .fflags =
0x00000000, .data = 0x000084c6}

.ident == 1 is stdout.
.filter == 0x fffffffe is -2 is EVFILT_WRITE which makes sense for stdout.
.fflags is empty, nothing out of ordinary for EVFILT_WRITE.
And here comes the oddity: .flags == 0x0001 means EV_ADD which totally
doesn't make sense to me and neither does according to man kqueue. The
code that exhibits this behaviour is io_loop_handler_run() in
ioloop-kqueue.c of Dovecot IMAP server.

I have re-read the docs more than once but I haven't noticed any sign of
that EV_ADD could be set for EVFILT_WRITE filter when I am receiving the
events through kevent() funtion. I am out of ideas what to do with it.

So I am asking all you hackers for any ideas of what might be going
wrong. Is it the code in Dovecot or is it FreeBSD that is doing
something wrong?


Vaclav Haisman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 544 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060401/7a0a90d4/signature.pgp


More information about the freebsd-hackers mailing list