Mads
Multi-Agent Distributed System
Loading...
Searching...
No Matches
Mads::detail::fd_limit_impl Namespace Reference

Functions

std::optional< uint64_t > read_uint_file (const char *path)
 Reads a single unsigned integer out of a /proc or /sys file.
 
std::optional< uint64_t > kernel_fd_ceiling ()
 

Function Documentation

◆ kernel_fd_ceiling()

std::optional< uint64_t > Mads::detail::fd_limit_impl::kernel_fd_ceiling ( )
inline

The kernel's own hard ceiling on a per-process descriptor table, which is NOT the same thing as RLIMIT_NOFILE's rlim_max: on macOS rlim_max is routinely RLIM_INFINITY while setrlimit() still fails with EINVAL above kern.maxfilesperproc, and on Linux it fails with EPERM above fs.nr_open. Clamping here is what keeps plan_fd_limit() from proposing the impossible.

Definition at line 113 of file fd_limit.hpp.

References read_uint_file().

Referenced by Mads::detail::query_fd_limits().

◆ read_uint_file()

std::optional< uint64_t > Mads::detail::fd_limit_impl::read_uint_file ( const char *  path)
inline

Reads a single unsigned integer out of a /proc or /sys file.

Definition at line 98 of file fd_limit.hpp.

Referenced by kernel_fd_ceiling().