Hello. 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). 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. 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. 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: http://codepad.org/l3uIKt8c
So, it seems that Solid code that watches for mtab is useless. Or am i misunderstanding something?
_______________________________________________ Kde-hardware-devel mailing list Kde-hardware-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-hardware-devel