summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pal/src/exception/signal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index 458e331698..7f2e5c5b3d 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -199,6 +199,10 @@ Return :
void FreeSignalAlternateStack()
{
stack_t ss, oss;
+ // The man page for sigaltstack says that when the ss.ss_flags is set to SS_DISABLE,
+ // all other ss fields are ignored. However, MUSL implementation checks that the
+ // ss_size is >= MINSIGSTKSZ even in this case.
+ ss.ss_size = MINSIGSTKSZ;
ss.ss_flags = SS_DISABLE;
int st = sigaltstack(&ss, &oss);
if ((st == 0) && (oss.ss_flags != SS_DISABLE))