aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongodb/musl-process-stack-size.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-02-23 13:01:26 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-02-23 13:01:26 +0000
commite9cbe2a20b5d4b7a951ba41236feb0523241c3ea (patch)
treebfdb31394a3a1c9a405163354a32ab4f66d1ae3d /testing/mongodb/musl-process-stack-size.patch
parent06354fc6bd7f9a8a887a005c91b066906ed017ec (diff)
downloadaports-e9cbe2a20b5d4b7a951ba41236feb0523241c3ea.tar.bz2
aports-e9cbe2a20b5d4b7a951ba41236feb0523241c3ea.tar.xz
testing/mongodb: use getrlimit() to get main process stack size
Diffstat (limited to 'testing/mongodb/musl-process-stack-size.patch')
-rw-r--r--testing/mongodb/musl-process-stack-size.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/mongodb/musl-process-stack-size.patch b/testing/mongodb/musl-process-stack-size.patch
new file mode 100644
index 0000000000..dd45abb8ed
--- /dev/null
+++ b/testing/mongodb/musl-process-stack-size.patch
@@ -0,0 +1,22 @@
+--- mongodb-src-r3.2.1.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
++++ mongodb-src-r3.2.1/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
+@@ -31,6 +31,7 @@
+ #include "mongo/platform/stack_locator.h"
+
+ #include <pthread.h>
++#include <sys/resource.h>
+
+ #include "mongo/util/assert_util.h"
+ #include "mongo/util/scopeguard.h"
+@@ -52,6 +53,11 @@
+ invariant(result == 0);
+ invariant(base != nullptr);
+ invariant(size != 0);
++
++ struct rlimit rl;
++
++ invariant(getrlimit(RLIMIT_STACK, &rl) == 0);
++ size = rl.rlim_cur ? : 2 * 1024 * 1024;
+
+ // TODO: Assumes a downward growing stack. Note here that
+ // getstack returns the stack *base*, being the bottom of the