in reply to sending signal to forked process
Is this you are expecting,
my $pid; sub handler { if($pid==0) { print "sig",shift,"received\n"; } else { $SIG{'INT'}='DEFAULT'; } } $SIG{'INT'}=\&handler; $pid=fork(); if($pid==0) { print "child\n"; sleep(10); } else { wait(); print "parent\n"; sleep(30); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: sending signal to forked process
by ajeet@perl (Acolyte) on Apr 07, 2010 at 14:17 UTC |
In Section
Seekers of Perl Wisdom