MCPcopy Create free account
hub / github.com/prometheus/procfs / GetProcMounts

Function GetProcMounts

mountinfo.go:183–189  ·  view source on GitHub ↗

GetProcMounts retrieves mountinfo information from a processes' `/proc/ /mountinfo`.

(pid int)

Source from the content-addressed store, hash-verified

181
182// GetProcMounts retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`.
183func GetProcMounts(pid int) ([]*MountInfo, error) {
184 data, err := readMountInfo(fmt.Sprintf("/proc/%d/mountinfo", pid))
185 if err != nil {
186 return nil, err
187 }
188 return parseMountInfo(data)
189}
190
191// GetMounts retrieves mountinfo information from `/proc/self/mountinfo`.
192func (fs FS) GetMounts() ([]*MountInfo, error) {

Callers

nothing calls this directly

Calls 2

readMountInfoFunction · 0.85
parseMountInfoFunction · 0.85

Tested by

no test coverage detected