Can we reset sigsetjmp to return “0” again (Reset sigsetjmp)?
I have written a segmentation fault handler, using sigsetjmp and siglongjmp. Once it goes to the signal handler, i invoke siglongjmp so that the faulty instruction is skipped. Problem is, i again want to cause SIGSEGV and go to the same handler, but now sigsetjmp will return 1. How to reset sigsetjmp? Here is my code: #include <stdio.h> #include <memory.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <sys/types.h> #include <fcntl.h> #include <signal.h> #include <setjmp.h> sigjmp_buf env, env1; void SIGSEGV_handler(int signal) { printf("Segmentation fault caught\n");