Function nix::sys::resource::getrlimit
pub fn getrlimit(resource: Resource) -> Result<(Option<rlim_t>, Option<rlim_t>)>Documentation
Get the current processes resource limits
A value of None indicates the value equals to RLIM_INFINITY which means
there is no limit.
Parameters
resource: TheResourcethat we want to get the limits of.
Examples
let (soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap();
println!("current soft_limit: {:?}", soft_limit);
println!("current hard_limit: {:?}", hard_limit);