package fscommon

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

Index

Variables

var (
	ErrNotValidFormat = errors.New("line is not a valid key value format")
)

Functions

func GetCgroupParamKeyValue

func GetCgroupParamKeyValue(t string) (string, uint64, error)

Parses a cgroup param and returns as name, value

i.e. "io_service_bytes 1234" will return as io_service_bytes, 1234

func GetCgroupParamString

func GetCgroupParamString(cgroupPath, cgroupFile string) (string, error)

Gets a string value from the specified cgroup file

func GetCgroupParamUint

func GetCgroupParamUint(cgroupPath, cgroupFile string) (uint64, error)

Gets a single uint64 value from the specified cgroup file.

func ParseUint

func ParseUint(s string, base, bitSize int) (uint64, error)

Saturates negative values at zero and returns a uint64. Due to kernel bugs, some of the memory cgroup stats can be negative.

func ReadFile

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

func WriteFile

func WriteFile(dir, file, data string) error

Source Files

fscommon.go utils.go

Version
v1.0.0-rc91
Published
Jun 30, 2020
Platform
linux/amd64
Imports
12 packages
Last checked
6 hours ago

Tools for package owners.