mirror of
https://github.com/containers/podman.git
synced 2025-09-27 00:34:32 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.0.3 to 1.1.0. - [Release notes](https://github.com/opencontainers/runc/releases) - [Changelog](https://github.com/opencontainers/runc/blob/master/CHANGELOG.md) - [Commits](https://github.com/opencontainers/runc/compare/v1.0.3...v1.1.0) --- updated-dependencies: - dependency-name: github.com/opencontainers/runc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
28 lines
505 B
Go
28 lines
505 B
Go
package cgroups
|
|
|
|
import (
|
|
"io/fs"
|
|
"path/filepath"
|
|
)
|
|
|
|
// GetAllPids returns all pids from the cgroup identified by path, and all its
|
|
// sub-cgroups.
|
|
func GetAllPids(path string) ([]int, error) {
|
|
var pids []int
|
|
err := filepath.WalkDir(path, func(p string, d fs.DirEntry, iErr error) error {
|
|
if iErr != nil {
|
|
return iErr
|
|
}
|
|
if !d.IsDir() {
|
|
return nil
|
|
}
|
|
cPids, err := readProcsFile(p)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
pids = append(pids, cPids...)
|
|
return nil
|
|
})
|
|
return pids, err
|
|
}
|