aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-04-07 13:40:13 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-04-07 13:40:13 +0200
commit906adadacd2d1c98346a2f42c0b42a32d2806d94 (patch)
tree9f5857a50ba968408242bd766bf592eefe803495 /src/nix/main.cc
parent9b9e703df41d75949272059f9b8bc8b763e91fce (diff)
Restore stack size in child processes
Fixes #4673.
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index f8701ee56..008482be3 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -17,10 +17,6 @@
#include <netdb.h>
#include <netinet/in.h>
-#if __linux__
-#include <sys/resource.h>
-#endif
-
#include <nlohmann/json.hpp>
extern std::string chrootHelperName;
@@ -335,14 +331,7 @@ int main(int argc, char * * argv)
{
// Increase the default stack size for the evaluator and for
// libstdc++'s std::regex.
- #if __linux__
- rlim_t stackSize = 64 * 1024 * 1024;
- struct rlimit limit;
- if (getrlimit(RLIMIT_STACK, &limit) == 0 && limit.rlim_cur < stackSize) {
- limit.rlim_cur = stackSize;
- setrlimit(RLIMIT_STACK, &limit);
- }
- #endif
+ nix::setStackSize(64 * 1024 * 1024);
return nix::handleExceptions(argv[0], [&]() {
nix::mainWrapped(argc, argv);