Files
sparsebundlefs-mirror/sparsebundlefs.cpp
Tor Arne Vestbø 1181dee042 Account for already used file descriptors when computing max open files
The process already has some existing file descriptors open, e.g. stdin,
stdout and stderr, so we can't assume we can open as many files as the
RLIMIT_NOFILE tells us.

A different approach to this is to not use a static limit of maximum
open files, but instead react to EMFILE when trying to open new files,
and then close existing files, but as a stop gap we compute a more
accurate static value for the maximum open files.

Fixes #35
2021-06-26 23:05:35 +02:00

20 KiB