From 222340137b832ca25d147cd3a7c03a40d2477fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 18 Dec 2023 13:51:00 +0100 Subject: [PATCH 1/2] Reapply "fix: set the SA_ONSTACK flag" This reverts commit 81b76df72ed008302bc6838442784eee69f9ebf9. --- thpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thpool.c b/thpool.c index 8bc782a..004b4bc 100644 --- a/thpool.c +++ b/thpool.c @@ -349,7 +349,7 @@ static void* thread_do(struct thread* thread_p){ /* Register signal handler */ struct sigaction act; sigemptyset(&act.sa_mask); - act.sa_flags = 0; + act.sa_flags = SA_ONSTACK; act.sa_handler = thread_hold; if (sigaction(SIGUSR1, &act, NULL) == -1) { err("thread_do(): cannot handle SIGUSR1"); From d3f1967cd37833a81eb8b0df26cf5206a53e8838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 18 Dec 2023 13:24:33 +0100 Subject: [PATCH 2/2] fix: ensure that SA_ONSTACK is declared --- thpool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/thpool.c b/thpool.c index 004b4bc..0d60a65 100644 --- a/thpool.c +++ b/thpool.c @@ -14,6 +14,9 @@ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 +#endif #endif #include #include