Need assistance regarding SIGSEGV signal handling.
I want the signal handler to catch the signal do some coding there, and return to main.
I succeeded in catching the signal SIGSEGV.
But the control does not return to main from signal handler function.
Please guide me to solve this problem.

I have written a sample code to catch the SIGSEGV signal and handle it.

My Sample Code:

#include <unistd.h>
#include <sys/types.h>
#include <signal.h>

void seg()
printf("SEGV caught\n");

int main ( )
int* ptr = (int*)0;

signal( SIGSEGV, seg);

*ptr = 1;

printf("End of main\n");

return 0;

SEGV caught
SEGV caught
Goes on like this infinitely and control does not return to main.