MCPcopy Create free account
hub / github.com/containerd/cgroups / Create

Method Create

cgroup1/pids.go:46–59  ·  view source on GitHub ↗
(path string, resources *specs.LinuxResources)

Source from the content-addressed store, hash-verified

44}
45
46func (p *pidsController) Create(path string, resources *specs.LinuxResources) error {
47 if err := os.MkdirAll(p.Path(path), defaultDirPerm); err != nil {
48 return err
49 }
50 if resources.Pids != nil && resources.Pids.Limit != nil &&
51 *resources.Pids.Limit > 0 {
52 return os.WriteFile(
53 filepath.Join(p.Path(path), "pids.max"),
54 []byte(strconv.FormatInt(*resources.Pids.Limit, 10)),
55 defaultFilePerm,
56 )
57 }
58 return nil
59}
60
61func (p *pidsController) Update(path string, resources *specs.LinuxResources) error {
62 return p.Create(path, resources)

Callers 1

UpdateMethod · 0.95

Calls 1

PathMethod · 0.95

Tested by

no test coverage detected