linux-cgroup-0.1.1.2: Very basic interface to the Linux CGroup Virtual Filesystem

Portabilityportable
Stabilityexperimental
Safe HaskellSafe-Inferred

System.Linux.Process.CGroup.VFS

Contents

Description

This module interfaces with the linux cgroup virtual filesystem to fetch various basic data. Note that this is an experimental iteration of the API, and subject to change.

Synopsis

Types

data CGroup Source

Contains a reference to the system cgroup. Typically this will be a system path in '/sys/fs/cgroups'

Instances

CGroups

allCGroups :: Bool -> IO [CGroup]Source

Produces a list of cgroups active on the system. Assumes '/proc/mounts' contains mounts on system.

Tasks (Processes)

listTasks :: CGroup -> IO [ProcessID]Source

List all PIDs associated with a cgroup. If the cgroup does not exist, an empty list is produced.

addTask :: CGroup -> ProcessID -> IO ()Source

Adds a PID to a cgroup. If the PID or cgroup does not exist, no action is taken.