Subject: Re: kern/33752 (Bug in kqueue VNODE handling)
To: None <jdolecek@NetBSD.org, netbsd-bugs@netbsd.org,>
From: None <jdolecek@netbsd.org>
List: netbsd-bugs
Date: 06/17/2006 08:56:53
Synopsis: Bug in kqueue VNODE handling

State-Changed-From-To: analyzed->closed
State-Changed-By: jdolecek@netbsd.org
State-Changed-When: Sat, 17 Jun 2006 08:56:52 +0000
State-Changed-Why:
Both issues are problems in the sample program.

It's documented feature that the attribute stays set when triggered.
If you want the flag to be cleared, you need to use EV_CLEAR flag.
This fixes problem 1)

The problem 2) (when EV_ONESHOT is used) happens since you are
effectively re-adding the event on each call to kevent(). The loop
should be re-coded to:

EV_SET(...)
nev = kevent(kq, &change, 1, NULL, 0, NULL);

for(;;) {
	nev = kevent(kq, NULL, 0, &event, 1, NULL);
	...
}