Skip to main content

Module limits

Module limits 

Source
Expand description

Process resource-limit utilities.

The helpers query soft and hard limits and raise selected soft limits when supported. Platform-specific implementations provide neutral fallbacks when an interface is unavailable.

Re-exportsΒ§

use std::fs::read_to_string; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use nix::sys::resource::Resource; πŸ”’
use nix::sys::resource::getrlimit; πŸ”’
use nix::unistd::SysconfVar; πŸ”’
use nix::unistd::sysconf; πŸ”’
use crate::Result; πŸ”’
use crate::utils::result::FlatOk; πŸ”’
use crate::apply; πŸ”’
use crate::debug; πŸ”’
use crate::debug; πŸ”’
use crate::utils::math::ExpectInto; πŸ”’

FunctionsΒ§

cgroup_max_tasks
Returns the cgroup task-count limit applying to this process.
max_file_descriptors
Returns the soft and hard file-descriptor limits.
max_memory_locked
Returns the soft and hard locked-memory limits.
max_stack_size
Returns the soft and hard process stack-size limits.
max_threads
Returns the soft and hard per-user process-count limits.
maximize_fd_limit
Raises the soft file descriptor limit to the current hard limit.
maximize_thread_limit
Raises the soft thread limit to the current hard limit.
page_size
Get the system’s page size in bytes.
pids_max πŸ”’
Reads one cgroup pids.max file.