I'm know I can monitor (using poll, or select) on the files
/etc/mtab and findout WHEN a filesystem is mounted or unmounted. Also I can use getmntent for getting a list of mounted filesystems.
My app is intended to monitor the mounted filesystem and report any change (mount or unmount).
- Detect some change in
- Get all currently mounted filesystem with
- Compare the obtained list with some previous list.
- Process the difference.
But I need to know if there are some way to get the last filesystem mounted when polling from
/etc/mtab. Just reading the file or polling data into some structure (like
mntent for instance.)