--- Shridhar Daithankar
<[EMAIL PROTECTED]> wrote:

> P.S. As I type this KMail crashed, for unknown
> reasons but when I restarted 
> it my half way composed e-mail was intact. I am
> amzed. Just for sake of 
> understanding, I would like to know how this is
> handled?...;-)

Like this:

#include <stdio.h>
#include <signal.h>

void handler (int x)
{
     printf ("Something went wrong\n");
     exit (1);
}

int main ()
{
     char *ptr = NULL;
     signal (SIGSEGV, handler);
     *ptr = 1;
     return 0;
}

(db2,SWF50_DEV)/u/rprash> cc test.c
(db2,SWF50_DEV)/u/rprash> ./a.out 
Something went wrong
(db2,SWF50_DEV)/u/rprash>

Instead of printing "Something went wrong", save the file.

____________________________________________________________
Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat events. Visit 
http://in.groups.yahoo.com

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to