v3 – github.com/containerd/cgroups/v3 Index | Files | Directories

package cgroups

import "github.com/containerd/cgroups/v3"

Index

Functions

func ParseCgroupFileUnified

func ParseCgroupFileUnified(path string) (map[string]string, string, error)

ParseCgroupFileUnified returns legacy subsystem paths as the first value, and returns the unified path as the second value.

func ParseCgroupFromReaderUnified

func ParseCgroupFromReaderUnified(r io.Reader) (map[string]string, string, error)

ParseCgroupFromReaderUnified returns legacy subsystem paths as the first value, and returns the unified path as the second value.

func RunningInUserNS

func RunningInUserNS() bool

RunningInUserNS detects whether we are currently running in a user namespace. Copied from github.com/lxc/lxd/shared/util.go

Deprecated: use userns.RunningInUserNS.

Types

type CGMode

type CGMode int

CGMode is the cgroups mode of the host system

const (
	// Unavailable cgroup mountpoint
	Unavailable CGMode = iota
	// Legacy cgroups v1
	Legacy
	// Hybrid with cgroups v1 and v2 controllers mounted
	Hybrid
	// Unified with only cgroups v2 mounted
	Unified
)

func Mode

func Mode() CGMode

Mode returns the cgroups mode running on the host

Source Files

utils.go

Directories

PathSynopsis
cgroup1
cgroup1/stats
cgroup2
cgroup2/stats
Version
v3.0.5 (latest)
Published
Dec 17, 2024
Platform
linux/amd64
Imports
9 packages
Last checked
1 week ago

Tools for package owners.