A simple wrapper for getrlimit
and setrlimit
.
const SOFT: rlim = 4 * 1024 * 1024;
const HARD: rlim = 8 * 1024 * 1024;
assert!(Resource::FSIZE.set(SOFT, HARD).is_ok());
or
assert!(setrlimit(Resource::FSIZE, SOFT, HARD).is_ok());
assert_eq!(getrlimit(Resource::CPU).unwrap(), (RLIM_INFINITY, RLIM_INFINITY));
Support more targets.
Current targets |
---|
i686-unknown-linux-gnu |
i686-unknown-linux-musl |
x86_64-unknown-linux-gnu |
x86_64-unknown-linux-musl |
x86_64-apple-darwin |