Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created March 13, 2010 21:05
Show Gist options
  • Save methodmissing/331549 to your computer and use it in GitHub Desktop.
Save methodmissing/331549 to your computer and use it in GitHub Desktop.
static void
create_sigstack()
{
stack_t ss;
ss.ss_size = SIGSTKSZ;
ss.ss_sp = malloc(ss.ss_size);
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
free(ss.ss_sp);
fprintf(stderr, "Couldn't create signal stack! Error %d: %s\n", errno, strerror(errno));
exit(1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment