nix::sys::resource

Function getrlimit

Source
pub fn getrlimit(resource: Resource) -> Result<(Option<rlim_t>, Option<rlim_t>)>
Expand description

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: The Resource that 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);

§References

getrlimit(2)