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

Method RootDir

proc.go:195–202  ·  view source on GitHub ↗

RootDir returns the absolute path to the process's root directory (as set by chroot).

()

Source from the content-addressed store, hash-verified

193
194// RootDir returns the absolute path to the process's root directory (as set by chroot).
195func (p Proc) RootDir() (string, error) {
196 rdir, err := os.Readlink(p.path("root"))
197 if os.IsNotExist(err) {
198 return "", nil
199 }
200
201 return rdir, err
202}
203
204// FileDescriptors returns the currently open file descriptors of a process.
205func (p Proc) FileDescriptors() ([]uintptr, error) {

Callers 1

TestRootFunction · 0.80

Calls 1

pathMethod · 0.95

Tested by 1

TestRootFunction · 0.64