Linux kernel version 5.8 added support for the stx_mnt_id field in the struct statx because "Systemd is hacking around to get it and it's trivial to add to statx, so...". This allows us to much more neatly match the lines in /proc/self/mountinfo. The same kernel version added STATX_ATTR_MOUNT_ROOT so we can tell if a given path is the mount point of a filesystem. We don't have a need for that information for now. We need to retain fallback code for two reasons: first, the user may be running with an old Linux kernel, in which case we won't get the STATX_MNT_ID bit set in stx_mask. Second, we may have failed to open() the path in question, because the user may not have the necessary permissions. There's still a race condition because the mount IDs can be reused immediately after something is unmounted. There's a 64-bit unique mount ID (available since v6.8) but it's not reported in /proc/self/mountinfo, so we couldn't us it right now. We can with 6.8's statmount(). Task-number: QTBUG-125721 Change-Id: If3345151ddf84c43a4f1fffd17d3f7dbce4ff16b Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> (cherry picked from commit 8836b677786ec4c967a9adfe5fc7a1febcb1a12e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%