on GNU/kFreeBSD, GNU/Hurd and Linux <2.4.19, /proc/self/mounts is not exposed. /proc/mounts should be used for the best compatibility. On modern Linux, with the introduction of per-process mount namespaces in Linux 2.4.19, /proc/mounts becames a link to /proc/self/mounts. (man proc(5)) It does not hurt to read /proc/mounts under Linux. Reproducible: Always
Created attachment 458750 [details, diff] read-proc-mounts-in-mountinfo.patch
https://github.com/OpenRC/openrc/commit/b73941f I didn't use your patch because I made the path a constant which can be conditionally defined for different operating systems if necessary in the future. This is in 0.23.1 and will be in 0.24.
Looks good to me, thanks!