Only close currently open descriptors on Linux
Summary: folly::Subprocess attempts to close (nearly) all file descriptors if `closeOtherFds()` option is set. When the process limit for number of file descriptors is large, but the actual number of open descriptors is low, much time is spent calling `close()` on files that are not actually open. On Linux, we can use the information in `/proc/self/fd` to close only those files that are actually open to speed up the process in the normal case. Reviewed By: yfeldblum Differential Revision: D33128499 fbshipit-source-id: efa5a348ff657c8212d9329a3efc7dd5bc0bb4d9
Showing
Please register or sign in to comment