mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
cpu: change cfs_quota from u64 to i64
cfs_quota can be set to -1 to indicate no limit Fixes: #5 Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
+12
@@ -768,3 +768,15 @@ pub fn libc_rmdir(p: &str) {
|
||||
// with int return value
|
||||
let _ = unsafe { libc::rmdir(p.as_ptr() as *const i8) };
|
||||
}
|
||||
|
||||
/// read and parse an i64 data
|
||||
pub fn read_i64_from(mut file: File) -> Result<i64> {
|
||||
let mut string = String::new();
|
||||
match file.read_to_string(&mut string) {
|
||||
Ok(_) => string
|
||||
.trim()
|
||||
.parse()
|
||||
.map_err(|e| Error::with_cause(ParseError, e)),
|
||||
Err(e) => Err(Error::with_cause(ReadFailed, e)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user