Skip to content

Commit

Permalink
Merge pull request #128 from dunglas/fix/SA_ONSTACK_declaration
Browse files Browse the repository at this point in the history
fix: ensure that SA_ONSTACK is declared
  • Loading branch information
Pithikos authored Dec 18, 2023
2 parents 6b45b07 + d3f1967 commit 9577c67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
#endif
#include <unistd.h>
#include <signal.h>
Expand Down Expand Up @@ -349,7 +352,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");
Expand Down

0 comments on commit 9577c67

Please sign in to comment.