name.go 606 B

12345678910111213141516171819202122232425262728293031
  1. package fs
  2. import (
  3. "github.com/opencontainers/runc/libcontainer/cgroups"
  4. "github.com/opencontainers/runc/libcontainer/configs"
  5. )
  6. type NameGroup struct {
  7. GroupName string
  8. Join bool
  9. }
  10. func (s *NameGroup) Name() string {
  11. return s.GroupName
  12. }
  13. func (s *NameGroup) Apply(path string, _ *configs.Resources, pid int) error {
  14. if s.Join {
  15. // Ignore errors if the named cgroup does not exist.
  16. _ = apply(path, pid)
  17. }
  18. return nil
  19. }
  20. func (s *NameGroup) Set(_ string, _ *configs.Resources) error {
  21. return nil
  22. }
  23. func (s *NameGroup) GetStats(path string, stats *cgroups.Stats) error {
  24. return nil
  25. }