1
//! Code to adjust process-related parameters.
2

            
3
use arti_client::TorClientConfig;
4

            
5
/// Set our current maximum-file limit to a large value, if we can.
6
///
7
/// Since we're going to be used as a proxy, we're likely to need a
8
/// _lot_ of simultaneous sockets.
9
///
10
/// # Limitations
11
///
12
/// This doesn't actually do anything on windows.
13
pub fn use_max_file_limit(config: &TorClientConfig) {
14
    match rlimit::increase_nofile_limit(config.system.max_files) {
15
        Ok(n) => tracing::debug!("Increased process file limit to {}", n),
16
        Err(e) => tracing::warn!("Error while increasing file limit: {}", e),
17
    }
18
}