mirror of
https://github.com/MeiK2333/river.git
synced 2025-11-04 14:49:40 +08:00
Update
This commit is contained in:
parent
efed729ce8
commit
97a37345cd
21
src/cgroup.rs
Normal file
21
src/cgroup.rs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
use std::result;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum Error {
|
||||||
|
Error(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type Result<T> = result::Result<T, Error>;
|
||||||
|
|
||||||
|
pub struct Cgroup {
|
||||||
|
pid: u32
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Cgroup {
|
||||||
|
pub fn new(pid: u32) -> Result<Self> {
|
||||||
|
return Ok(Cgroup { pid });
|
||||||
|
}
|
||||||
|
pub fn attach(&self) -> Result<()> {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/main.rs
15
src/main.rs
@ -1,15 +1,18 @@
|
|||||||
|
extern crate libc;
|
||||||
|
|
||||||
|
mod cgroup;
|
||||||
|
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
|
use std::process;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use libc;
|
|
||||||
use libc::{time_t, suseconds_t, c_long};
|
use libc::{time_t, suseconds_t, c_long};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
run();
|
run();
|
||||||
cgroup();
|
match cgroup::Cgroup::new(process::id()) {
|
||||||
}
|
Ok(_) => println!("Hello World!"),
|
||||||
|
Err(e) => println!("{:?}", e),
|
||||||
fn cgroup() {
|
}
|
||||||
println!("cgroup");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run() {
|
fn run() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user