package cgroups

import "github.com/opencontainers/runc/libcontainer/cgroups"

Index

Constants

const (
	CgroupNamePrefix = "name="
)

Variables

var (
	ErrV1NoUnified = errors.New("invalid configuration: cannot use unified on cgroup v1")
)
var (
	// TestMode is set to true by unit tests that need "fake" cgroupfs.
	TestMode bool
)

Functions

func FindCgroupMountpoint

func FindCgroupMountpoint(cgroupPath, subsystem string) (string, error)

https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt

func FindCgroupMountpointAndRoot

func FindCgroupMountpointAndRoot(cgroupPath, subsystem string) (string, string, error)

func GetInitCgroup

func GetInitCgroup(subsystem string) (string, error)

func GetInitCgroupPath

func GetInitCgroupPath(subsystem string) (string, error)

func GetOwnCgroup

func GetOwnCgroup(subsystem string) (string, error)

GetOwnCgroup returns the relative path to the cgroup docker is running in.

func GetOwnCgroupPath

func GetOwnCgroupPath(subsystem string) (string, error)

func IsNotFound

func IsNotFound(err error) bool

func NewNotFoundError

func NewNotFoundError(sub string) error

func OpenFile

func OpenFile(dir, file string, flags int) (*os.File, error)

OpenFile opens a cgroup file in a given dir with given flags. It is supposed to be used for cgroup files only.

func ReadFile

func ReadFile(dir, file string) (string, error)

ReadFile reads data from a cgroup file in dir. It is supposed to be used for cgroup files only.

func WriteFile

func WriteFile(dir, file, data string) error

WriteFile writes data to a cgroup file in dir. It is supposed to be used for cgroup files only.

Types

type NotFoundError

type NotFoundError struct {
	Subsystem string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Source Files

cgroups_unsupported.go file.go v1_utils.go

Directories

PathSynopsis
libcontainer/cgroups/devices
libcontainer/cgroups/ebpf
libcontainer/cgroups/ebpf/devicefilterPackage devicefilter contains eBPF device filter program
libcontainer/cgroups/fs
libcontainer/cgroups/fs2
libcontainer/cgroups/systemd
Version
v1.0.1
Published
Jul 16, 2021
Platform
js/wasm
Imports
13 packages
Last checked
3 hours ago

Tools for package owners.