Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604646 - read /proc/mounts in mountinfo for greatest compatibility
Summary: read /proc/mounts in mountinfo for greatest compatibility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All GNU/kFreeBSD
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-04 13:25 UTC by Benda Xu
Modified: 2017-01-07 03:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
read-proc-mounts-in-mountinfo.patch (0006-read-proc-mounts-in-mountinfo.patch,1.11 KB, patch)
2017-01-04 16:30 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2017-01-04 13:25:09 UTC
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
Comment 1 Benda Xu gentoo-dev 2017-01-04 16:30:06 UTC
Created attachment 458750 [details, diff]
read-proc-mounts-in-mountinfo.patch
Comment 2 William Hubbs gentoo-dev 2017-01-06 17:25:22 UTC
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.
Comment 3 Benda Xu gentoo-dev 2017-01-07 03:29:59 UTC
Looks good to me, thanks!