3 ms·
Kqueues are great!
by butterisgood 6y ago
Kqueues are great!
- JdeBP 6y agokevent() is indeed the MsgWaitForMultipleObjects() of the Unix world, a very useful mechanism, and indeed the very file directory monitoring library function that RNCTX wrongly claims to be lacking. But from experience of using it extensively in my softwares I can report that it has some warts on FreeBSD. A very quick précis: * It has problems if one wants to combine NOTE_TRACK, NOTE_FORK, and NOTE_EXIT in EVFILT_PROC, because it returns one event for both a forked child and an exited child, which both try to store different things in the single "data" field of the event. * Quite a few of the pollable device drivers in FreeBSD are not kevent() enabled. So it mysteriously fails to work with a whole bunch of I/O devices, where (confusingly for diagnosis) polling does. kevent() is not universally usable. * One might think, from reading the various operating system's manual pages, that only NetBSD and MacOS have EVFILT_FS. In fact, FreeBSD kevent() also has EVFILT_FS. It's just entirely undocumented.
- bnastic 6y agoYes, kqueue is very good, just not for the purpose in the OP's context - filesystem monitoring.