Can someone confirm whether you people getting my mails or not?
If yes, please commment on following code
 


  _____  

From: Rajnikant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 6:49 PM
To: 'Perl Beginners'
Subject: FW: Signal Handlers


Hello all,
 
I want to catch SIGSEGV signal, do some processing and after that want to
call default SIGSEGV handler.
I was not getting how to call default SIGSEGV handler. Following code
snippet is the work around I'm using.
Let me know if anything wrong in this code or your thaughts on this.
 
local $SIG{SEGV} = \&seg_handler;
our $sig=0;
sub seg_handler
{
    my $sig = shift;
    print "seg_handler :: Caught $sig \n";
    $SIG{$sig} ='DEFAULT';
    print "Sending $sig signale to proc $$\n";
    kill $sig,$$;
}
until ($sig) {
    print "running...\n";
    sleep 1;
}

 
 
 
 

  _____  

From: Rajnikant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 1:15 PM
To: 'Perl Beginners'
Subject: Signal Handlers


Hello Gurus,
 
I'm using following code snipet to catch SIGSEV signal.
 
local $SIG{SEGV} = \&seg_handler;
sub seg_handler
{
    my $sig = shift;
    print "seg_handler :: Caught $sig \n";
}

while (1)
{
     print ("Still alive \n");
     sleep 1;
}
 
When I send SEGV signal to this process (kill -11 proc_id) from command
promt, I'm able to catch this signal. 
I need to call default SEGV signal handler after my processing.
 
How should I code for this?
 
Thanks in advance.
 
 

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

Reply via email to