Submit #2905
closedAdd EVFILT_FS
0%
Description
Matt (or Sephe),
I'd like to add EVFILT_FS type to kqueue events.
autoumountd which is a userspace daemon of autofs needs this.
EVFILT_FS has existed in FreeBSD since 2004.
EVFILT_FS is triggered only when mounting or unmounting a filesystem.
(FreeBSD later added some NFS events in addition to mount/unmount, but this commit doesn't apply those)
The patch needs to be reviewed as I've only read kern/kern_event.c today to briefly understand the mechanism.
https://leaf.dragonflybsd.org/~tkusumi/diff/0001-sys-kern-Add-EVFILT_FS.patch
sample userspace code
https://leaf.dragonflybsd.org/~tkusumi/diff/kqueue1.c
--
[root@]~# gcc -Wall -g ./kqueue1.c -o ./kqueue1
[root@]~# ./kqueue1
timeout
timeout
timeout
timeout
timeout
timeout
filesystem event filter=-10 mount
timeout
timeout
filesystem event filter=-10 unmount
timeout
timeout
filesystem event filter=-10 mount
filesystem event filter=-10 unmount
timeout
timeout
timeout
^C