#include <subsystem.hpp>
|
static void | attach (const std::string &path, const std::vector< std::string > &subs) |
| Attach subsystem hierarchy to filesystem Equivalent of: mount -t cgroup -o subs(coma-sep) cgroup path Note: cgroup root must be already mounted (eg. More...
|
|
static void | detach (const std::string &path) |
| Detach subsstem hierarchy from filesystem Equivalent of: umount path. More...
|
|
static std::vector< std::string > | availableSubsystems () |
| Get list of available subsytems. More...
|
|
static std::vector< std::string > | getCGroups (pid_t pid) |
| Get control groups list for a process (in format subsys_name:cgroup_name) eg. More...
|
|
lxcpp::Subsystem::Subsystem |
( |
const std::string & |
name | ) |
|
void lxcpp::Subsystem::attach |
( |
const std::string & |
path, |
|
|
const std::vector< std::string > & |
subs |
|
) |
| |
|
static |
Attach subsystem hierarchy to filesystem Equivalent of: mount -t cgroup -o subs(coma-sep) cgroup path Note: cgroup root must be already mounted (eg.
/sys/fs/cgroup) as tmpfs
std::vector< std::string > lxcpp::Subsystem::availableSubsystems |
( |
| ) |
|
|
static |
Get list of available subsytems.
- Returns
- parse contents of /proc/cgroups
void lxcpp::Subsystem::detach |
( |
const std::string & |
path | ) |
|
|
static |
Detach subsstem hierarchy from filesystem Equivalent of: umount path.
std::vector< std::string > lxcpp::Subsystem::getCGroups |
( |
pid_t |
pid | ) |
|
|
static |
Get control groups list for a process (in format subsys_name:cgroup_name) eg.
"cpu:/user/test_user" Equivalent of: cat /proc/pid/cgroup
const std::string & lxcpp::Subsystem::getMountPoint |
( |
| ) |
const |
Get mount point of this subsystem.
- Returns
- subsystem mount point (as read from /proc/mounts)
const std::string& lxcpp::Subsystem::getName |
( |
| ) |
const |
|
inline |
bool lxcpp::Subsystem::isAttached |
( |
| ) |
const |
Check if named subsystem is mounted (added to hierarchy)
- Returns
- true if subsystem has a mount point (as read from /proc/mounts)
bool lxcpp::Subsystem::isAvailable |
( |
| ) |
const |
Check if named subsystem is supported by the kernel.
- Returns
- true if subsystem is listed in /proc/cgroups
std::string lxcpp::Subsystem::mName |
|
private |
std::string lxcpp::Subsystem::mPath |
|
private |
The documentation for this class was generated from the following files: