Function fdlimit::raise_fd_limit
source · pub fn raise_fd_limit() -> Option<u64>
Expand description
Raise the soft open file descriptor resource limit to the smaller of the kernel limit and the hard resource limit.
Returns Some
with the new limit.
Panics
Panics if libc::sysctl
, libc::getrlimit
or libc::setrlimit
fail.
darwin_fd_limit exists to work around an issue where launchctl on Mac OS X defaults the rlimit maxfiles to 256/unlimited. The default soft limit of 256 ends up being far too low for our multithreaded scheduler testing, depending on the number of cores available.