Struct cgroups_rs::devices::DevicesController [−][src]
pub struct DevicesController { /* fields omitted */ }
Expand description
A controller that allows controlling the devices
subsystem of a Cgroup.
In essence, using the devices controller, it is possible to allow or disallow sets of devices to be used by the control group’s tasks.
Implementations
Constructs a new DevicesController
with root
serving as the root of the control group.
pub fn allow_device(
&self,
devtype: DeviceType,
major: i64,
minor: i64,
perm: &[DevicePermissions]
) -> Result<()>
pub fn allow_device(
&self,
devtype: DeviceType,
major: i64,
minor: i64,
perm: &[DevicePermissions]
) -> Result<()>
Allow a (possibly, set of) device(s) to be used by the tasks in the control group.
When -1
is passed as major
or minor
, the kernel interprets that value as “any”,
meaning that it will match any device.
pub fn deny_device(
&self,
devtype: DeviceType,
major: i64,
minor: i64,
perm: &[DevicePermissions]
) -> Result<()>
pub fn deny_device(
&self,
devtype: DeviceType,
major: i64,
minor: i64,
perm: &[DevicePermissions]
) -> Result<()>
Deny the control group’s tasks access to the devices covered by dev
.
When -1
is passed as major
or minor
, the kernel interprets that value as “any”,
meaning that it will match any device.
Get the current list of allowed devices.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DevicesController
impl Send for DevicesController
impl Sync for DevicesController
impl Unpin for DevicesController
impl UnwindSafe for DevicesController
Blanket Implementations
Mutably borrows from an owned value. Read more
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
Attach a task to this controller by thread group id.