Этот коммит содержится в:
Christopher Speller
2018-09-28 12:40:17 -07:00
коммит произвёл GitHub
родитель 006623e0f7
Коммит a8c01377bc
272 изменённых файлов: 23302 добавлений и 4225 удалений

20
vendor/github.com/prometheus/procfs/proc.go сгенерированный поставляемый
Просмотреть файл

@@ -156,6 +156,26 @@ func (p Proc) Executable() (string, error) {
return exe, err
}
// Cwd returns the absolute path to the current working directory of the process.
func (p Proc) Cwd() (string, error) {
wd, err := os.Readlink(p.path("cwd"))
if os.IsNotExist(err) {
return "", nil
}
return wd, err
}
// RootDir returns the absolute path to the process's root directory (as set by chroot)
func (p Proc) RootDir() (string, error) {
rdir, err := os.Readlink(p.path("root"))
if os.IsNotExist(err) {
return "", nil
}
return rdir, err
}
// FileDescriptors returns the currently open file descriptors of a process.
func (p Proc) FileDescriptors() ([]uintptr, error) {
names, err := p.fileDescriptors()