Write a signal handler to catch SIGSEGV
- by Adi
Hi all,
I want to write a signal handler to catch SIGSEGV.
First , I would protect a block of memory for read or writes using
char *buffer;
char *p;
char a;
int pagesize = 4096;
" mprotect(buffer,pagesize,PROT_NONE) "
What this will do is , it will protect the memory starting from buffer till pagesize for any reads or writes.
Second , I…