nix::sys::resource

Function getrlimit

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

Get the current processes resource limits

The special value RLIM_INFINITY indicates that no limit will be enforced.

§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)