aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_bsd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'executor/executor_bsd.cc')
-rw-r--r--executor/executor_bsd.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/executor/executor_bsd.cc b/executor/executor_bsd.cc
index e14d36109..f55dccd54 100644
--- a/executor/executor_bsd.cc
+++ b/executor/executor_bsd.cc
@@ -88,6 +88,12 @@ int main(int argc, char** argv)
rlim.rlim_cur = rlim.rlim_max = 0;
setrlimit(RLIMIT_CORE, &rlim);
+ const int nfiles = 1 << 8;
+ if (kInPipeFd >= nfiles)
+ fail("RLIMIT_NOFILE too low: %d > %d", kInPipeFd, nfiles);
+ rlim.rlim_cur = rlim.rlim_max = nfiles;
+ setrlimit(RLIMIT_NOFILE, &rlim);
+
install_segv_handler();
main_init();
reply_handshake();