Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error on newer ubuntu releases #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/sim/init_signals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,19 @@
using namespace std;

// Use an separate stack for fatal signal handlers
static uint8_t fatalSigStack[2 * SIGSTKSZ];

static bool
setupAltStack()
{
const auto stack_size = 2 * SIGSTKSZ;
static uint8_t *fatal_sig_stack = new uint8_t[stack_size];
stack_t stack;
#if defined(__FreeBSD__) && (__FreeBSD_version < 1100097)
stack.ss_sp = (char *)fatalSigStack;
stack.ss_sp = (char *)fatal_sig_stack;
#else
stack.ss_sp = fatalSigStack;
stack.ss_sp = fatal_sig_stack;
#endif
stack.ss_size = sizeof(fatalSigStack);
stack.ss_size = stack_size;
stack.ss_flags = 0;

return sigaltstack(&stack, NULL) == 0;
Expand Down