1
0
mirror of https://github.com/opencontainers/runc.git synced 2025-08-08 12:42:06 +03:00

Revert to non-recursive GetPids, add recursive GetAllPids

Signed-off-by: Jimmi Dyson <jimmidyson@gmail.com>
This commit is contained in:
Jimmi Dyson
2016-01-08 19:37:18 +00:00
parent f03b7f8317
commit 91c7024e52
8 changed files with 51 additions and 15 deletions

View File

@@ -323,9 +323,14 @@ func GetHugePageSize() ([]string, error) {
return pageSizes, nil
}
// GetPids returns all pids, that were added to cgroup at path and to all its
// subcgroups.
// GetPids returns all pids, that were added to cgroup at path.
func GetPids(path string) ([]int, error) {
return readProcsFile(path)
}
// GetAllPids returns all pids, that were added to cgroup at path and to all its
// subcgroups.
func GetAllPids(path string) ([]int, error) {
var pids []int
// collect pids from all sub-cgroups
err := filepath.Walk(path, func(p string, info os.FileInfo, iErr error) error {