How to write a signal handler to catch SIGSEGV?

前端 未结 5 1364
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 15:26

I want to write a signal handler to catch SIGSEGV. I protect a block of memory for read or write using

char *buffer;
char *p;
char a;
int pagesize = 4096;

         


        
5条回答
  •  隐瞒了意图╮
    2020-11-22 16:02

    There is a compilation problem using ucontext_t or struct ucontext (present in /usr/include/sys/ucontext.h)

    http://www.mail-archive.com/arch-general@archlinux.org/msg13853.html

提交回复
热议问题