RootDir returns the absolute path to the process's root directory (as set by chroot).
()
| 193 | |
| 194 | // RootDir returns the absolute path to the process's root directory (as set by chroot). |
| 195 | func (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. |
| 205 | func (p Proc) FileDescriptors() ([]uintptr, error) { |