mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
fix(deps): update module github.com/opencontainers/cgroups to v0.0.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
13
vendor/github.com/opencontainers/cgroups/fs2/fs2.go
generated
vendored
13
vendor/github.com/opencontainers/cgroups/fs2/fs2.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/opencontainers/cgroups"
|
||||
@@ -83,6 +84,18 @@ func (m *Manager) Apply(pid int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddPid adds a process with a given pid to an existing cgroup.
|
||||
// The subcgroup argument is either empty, or a path relative to
|
||||
// a cgroup under under the manager's cgroup.
|
||||
func (m *Manager) AddPid(subcgroup string, pid int) error {
|
||||
path := filepath.Join(m.dirPath, subcgroup)
|
||||
if !strings.HasPrefix(path, m.dirPath) {
|
||||
return fmt.Errorf("bad sub cgroup path: %s", subcgroup)
|
||||
}
|
||||
|
||||
return cgroups.WriteCgroupProc(path, pid)
|
||||
}
|
||||
|
||||
func (m *Manager) GetPids() ([]int, error) {
|
||||
return cgroups.GetPids(m.dirPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user