Skip to content

Instantly share code, notes, and snippets.

View markmentovai's full-sized avatar

Mark Mentovai markmentovai

View GitHub Profile
// clang++ -Wall -Werror t_fault_sigaltstack_simple.cc -o t_fault_sigaltstack_simple
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
// clang++ -Wall -Werror -std=c++11 t_fault_sigaltstack.cc -o t_fault_sigaltstack -lpthread
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <libgen.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
// clang++ -Wall -Werror t_impossible_sigaltstack.cc -o t_impossible_sigaltstack
#include <err.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/mman.h>
namespace {
void HandleSignal(int sig, siginfo_t* info, void* ucontext) {