Skip to content

Commit 95f2efb

Browse files
authored
Merge pull request #47 from kolyshkin/mount-pid
mountinfo: deprecate PidMountInfo
2 parents 4413637 + 3358500 commit 95f2efb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mountinfo/mountinfo_linux.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,14 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
148148
return GetMountsFromReader(f, filter)
149149
}
150150

151-
// PidMountInfo collects the mounts for a specific process ID. If the process
152-
// ID is unknown, it is better to use `GetMounts` which will inspect
153-
// "/proc/self/mountinfo" instead.
151+
// PidMountInfo retrieves the list of mounts from a given process' mount
152+
// namespace. Unless there is a need to get mounts from a mount namespace
153+
// different from that of a calling process, use GetMounts.
154+
//
155+
// This function is Linux-specific.
156+
//
157+
// Deprecated: this will be removed before v1; use GetMountsFromReader with
158+
// opened /proc/<pid>/mountinfo as an argument instead.
154159
func PidMountInfo(pid int) ([]*Info, error) {
155160
f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid))
156161
if err != nil {

0 commit comments

Comments
 (0)