Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lxcpp::DevicesCGroup Class Reference

#include <devices.hpp>

+ Inheritance diagram for lxcpp::DevicesCGroup:

Public Member Functions

 DevicesCGroup (const std::string &name)
 
void allow (DevicePermission p)
 
void deny (DevicePermission p)
 
void allow (char type, int major, int minor, const std::string &perm)
 
void deny (char type, int major, int minor, const std::string &perm)
 
std::vector< DevicePermissionlist ()
 
bool exists () const
 Check if cgroup exists. More...
 
void create ()
 Create cgroup directory. More...
 
void destroy ()
 Destroy cgroup directory Equivalent of: rmdir subsys.path / mName Note: set memory.force_empty before removing a cgroup to avoid moving out-of-use page caches to parent. More...
 
void setCommonValue (const std::string &param, const std::string &value)
 Set common 'cgroup' parameter. More...
 
std::string getCommonValue (const std::string &param) const
 Get common 'cgroup' paramter. More...
 
void setValue (const std::string &param, const std::string &value)
 Set cgroup parameter to value (name validity depends on subsystem). More...
 
std::string getValue (const std::string &param) const
 Get cgroup parameter. More...
 
void assignGroup (pid_t pid)
 Assign all processes in threadgroup of pid to this cgroup. More...
 
void assignPid (pid_t pid)
 Assign single process to this cgroup (will be removed from previous cgroup automatically). More...
 
std::vector< pid_t > getPids () const
 Get list of pid assigned to this group. More...
 

Static Public Member Functions

static CGroup getCGroup (const std::string &subsys, pid_t pid)
 Get cgroup of process pid in given subsystem. More...
 

Constructor & Destructor Documentation

lxcpp::DevicesCGroup::DevicesCGroup ( const std::string &  name)
inline

Member Function Documentation

void lxcpp::DevicesCGroup::allow ( DevicePermission  p)
void lxcpp::DevicesCGroup::allow ( char  type,
int  major,
int  minor,
const std::string &  perm 
)
void lxcpp::CGroup::assignGroup ( pid_t  pid)
inherited

Assign all processes in threadgroup of pid to this cgroup.

Equivalent of: echo pid > mSubsys_path/mName/cgroup.procs

void lxcpp::CGroup::assignPid ( pid_t  pid)
inherited

Assign single process to this cgroup (will be removed from previous cgroup automatically).

Equivalent of: echo pid > mSubsys_path/mName/tasks

void lxcpp::CGroup::create ( )
inherited

Create cgroup directory.

Equivalent of: mkdir subsys.path / mName

void lxcpp::DevicesCGroup::deny ( DevicePermission  p)
void lxcpp::DevicesCGroup::deny ( char  type,
int  major,
int  minor,
const std::string &  perm 
)
void lxcpp::CGroup::destroy ( )
inherited

Destroy cgroup directory Equivalent of: rmdir subsys.path / mName Note: set memory.force_empty before removing a cgroup to avoid moving out-of-use page caches to parent.

bool lxcpp::CGroup::exists ( ) const
inherited

Check if cgroup exists.

Returns
true if cgroup path (subsys.path / mName) exists
CGroup lxcpp::CGroup::getCGroup ( const std::string &  subsys,
pid_t  pid 
)
staticinherited

Get cgroup of process pid in given subsystem.

std::string lxcpp::CGroup::getCommonValue ( const std::string &  param) const
inherited

Get common 'cgroup' paramter.

Equivalent of: cat mSubsys_path/mName/cgroup.param

std::vector< pid_t > lxcpp::CGroup::getPids ( ) const
inherited

Get list of pid assigned to this group.

Equivalent of: cat mSubsys_path/mName/tasks

std::string lxcpp::CGroup::getValue ( const std::string &  param) const
inherited

Get cgroup parameter.

Equivalent of: cat mSubsys_path/mName/mSubsys_name.param

std::vector< DevicePermission > lxcpp::DevicesCGroup::list ( )
void lxcpp::CGroup::setCommonValue ( const std::string &  param,
const std::string &  value 
)
inherited

Set common 'cgroup' parameter.

Equivalent of: echo value > mSubsys_path/mName/cgroup.param

void lxcpp::CGroup::setValue ( const std::string &  param,
const std::string &  value 
)
inherited

Set cgroup parameter to value (name validity depends on subsystem).

Equivalent of: echo value > mSubsys_path/mName/mSubsys_name.param


The documentation for this class was generated from the following files: