There was an error while loading. Please reload this page.
2 parents e036314 + c2c761e commit bec29b3Copy full SHA for bec29b3
1 file changed
erts/emulator/sys/unix/sys_signal_stack.c
@@ -76,9 +76,7 @@
76
#include <signal.h>
77
#include <stdio.h>
78
#include <stdlib.h>
79
-#if defined(__linux__)
80
-# include <sys/auxv.h>
81
-#endif
+#include <unistd.h>
82
83
#include "sys.h"
84
#include "erl_alloc.h"
@@ -98,9 +96,11 @@
98
96
void sys_thread_init_signal_stack(void) {
99
97
stack_t ss;
100
101
-#if defined(__linux__) && defined(AT_MINSIGSTKSZ)
102
- ss.ss_size = (size_t) getauxval(AT_MINSIGSTKSZ);
103
- ss.ss_size = MAX(ss.ss_size, SIGSTKSZ);
+#if defined(_SC_MINSIGSTKSZ)
+ {
+ long min = sysconf(_SC_MINSIGSTKSZ);
+ ss.ss_size = MAX((size_t) (min > 0 ? min : SIGSTKSZ), (size_t) SIGSTKSZ);
+ }
104
#else
105
ss.ss_size = SIGSTKSZ;
106
#endif
0 commit comments