CreateCompletionPorton Windows this returns a handle to an event queue file descriptor.
kqueuesyscall will know what to do based on the arguments we provide. As we'll see, this results in a pretty elegant API but it can be a bit hard to wrap your head around in the start. It's documented on the same manpage as
closesyscall lets us do just that.
keventsyscall. This structure is the most important way for us to provide information to our
keventsyscall what we want to do.
BSDis passed as a
Timespecstruct. It's important for us since we want to be able to set a timeout for how long we want to wait for an event before the thread calling
pollis woken up.
Kqueuemanpage. However, getting the actual values can be pretty hard so I've gathered some of them here for you.