<div dir="ltr"><div><div><div><div>Hello.<br>I've been playing with Solid and found
that fstab backend monitors /etc/mtab file for changes to maintain an
up-to-date list of systems mounts. We at FreeBSD do not have /etc/mtab
file, but out Linux compatability layer provides it (under /proc/mounts
path though, but this is irrelevant).<br></div>Out of curiosity i
decided to read through FreeBSD source to find the code which updates
mtab file when mount/unmount event is fired. I've found that mtab is
implemented using pseudofs and it's content is being generated on read()
call. Because of that watching for it's changes is useless - it is
never changed and no events would be generated.<br></div>I've wrote a
simple program that waits for file events using kevent (a
FreeBSD-specific API, which is internally used by QFileSystemWatcher),
added a watcher for /proc/mounts, then mounted flash disk and expectedly
didn't get any event. Doing cat /proc/mounts gave me a list with my
flash disk listed in it.<br></div>I've done the same test on various Linuxes (but used inotify API instead of kevent) and got the same result. Here is the code i used: <a href="http://codepad.org/l3uIKt8c" target="_blank">http://codepad.org/l3uIKt8c</a><br><br></div>So, it seems that Solid code that watches for mtab is useless. Or am i misunderstanding something?</div>