I want some clarification on kqueue, EV_CLEAR flag

From: Ярослав Машко <yaroslaw.mashko_at_gmail.com>
Date: Sun, 16 Oct 2022 13:36:41 UTC
Hello,

I learn how to manage events with a kqueue. I did some research and have a
confusion with EV_CLEAR and EV_DISPATCH flags.

So this message contains two questions.

1. I see that EV_DISPATCH flag stays with event no matter what steps do I
take. The EV_ADD | EV_ENABLE leaves the EV_DISPATCH flag in.
There seem that the only way to switch off EV_DISPATCH is to delete event
completely. Is it the case?

2. I was confused after a look at the man pages for kqueue. EV_CLEAR
section tells that the state gets reset. My thought were that EV_DISPATCH
gets switched off. After that, I did read the /src/sys/kern/kern_event.c
source file. The only state that I had found changed is data plus fflags
fields. The was a confusing bit of manual.

-- 
Ярослав Машко

+380 50 56 75 347 <+380+50+56+75+347>