Expand description
Unified mount enumeration via statmount(2) with /proc/self/mountinfo fallback. Unified mount enumeration API.
Uses statmount(2) / listmount(2) on Linux >= 6.8 for direct kernel mount
queries, falling back to /proc/self/mountinfo text parsing on older kernels.
On kernels where statmount is available but SB_SOURCE is not (e.g. RHEL
10.2 kernel 6.12), the statmount results are enriched with source and options
from /proc/self/mountinfo.
Structs§
- Mount
Entry - A single mount point with fields matching
/proc/self/mountinfocolumns.
Functions§
- find_
mount_ for_ path - Find the mount entry whose
mount_pointis the longest prefix ofpath. - list_
mounts - Enumerate all mounts visible to the current process.
- list_
mounts_ proc - Parse
/proc/self/mountinfointoMountEntryvalues.