summaryrefslogtreecommitdiff
path: root/src/OptionHandlerFactory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/OptionHandlerFactory.cc')
-rw-r--r--src/OptionHandlerFactory.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index 409f2eab..f89a1c44 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -755,6 +755,25 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
op->addTag(TAG_ADVANCED);
handlers.push_back(op);
}
+#ifdef HAVE_SYS_RESOURCE_H
+ {
+ OptionHandler* op(new NumberOptionHandler
+ (PREF_RLIMIT_NOFILE,
+ TEXT_RLIMIT_NOFILE,
+ // Somewhat sane default that most *nix use.
+ // Some other *nix, like OSX, have insane defaults like
+ // 256, hence better *not* get the default value from
+ // getrlimit().
+ "1024",
+ // 1 should not be a problem in practise, since the code
+ // will only adjust if the specified value > the current
+ // soft limit.
+ // And sane systems have a default soft limit > 1.
+ 1));
+ op->addTag(TAG_ADVANCED);
+ handlers.push_back(op);
+ }
+#endif // HAVE_SYS_RESOURCE_H
{
OptionHandler* op(new BooleanOptionHandler
(PREF_SELECT_LEAST_USED_HOST,