Change 18568 by jhi@kosh on 2003/01/22 20:24:37 Add the POSIX::sigaction() trick by Slaven Rezic for [perl #17341].
Affected files ... ... //depot/maint-5.8/perl/pod/perlfunc.pod#7 edit ... //depot/maint-5.8/perl/pod/perlipc.pod#4 edit Differences ... ==== //depot/maint-5.8/perl/pod/perlfunc.pod#7 (text) ==== Index: perl/pod/perlfunc.pod --- perl/pod/perlfunc.pod#6~18379~ Tue Dec 31 07:33:11 2002 +++ perl/pod/perlfunc.pod Wed Jan 22 12:24:37 2003 @@ -429,6 +429,8 @@ # didn't } +For more information see L<perlipc>. + =item atan2 Y,X Returns the arctangent of Y/X in the range -PI to PI. ==== //depot/maint-5.8/perl/pod/perlipc.pod#4 (text) ==== Index: perl/pod/perlipc.pod --- perl/pod/perlipc.pod#3~18197~ Wed Nov 27 20:14:27 2002 +++ perl/pod/perlipc.pod Wed Jan 22 12:24:37 2003 @@ -279,7 +279,7 @@ sleep 2; # to avoid dup signals } -=head2 Deferred Signals +=head2 Deferred Signals (Safe Signals) In Perls before Perl 5.7.3 by installing Perl code to deal with signals, you were exposing yourself to danger from two things. First, @@ -339,6 +339,18 @@ Note that the default in Perl 5.7.3 and later is to automatically use the C<:perlio> layer. + +Note that some networking library functions like gethostbyname() are +known to have their own implementations of timeouts which may conflict +with your timeouts. If you are having problems with such functions, +you can try using the POSIX sigaction() function, which bypasses the +Perl safe signals (note that this means subjecting yourself to +possible memory corruption, as described above). Instead of setting +C<$SIG{ALRM}> try something like the following: + + use POSIX; + sigaction SIGALRM, new POSIX::SigAction sub { die "alarm\n" } + or die "Error setting SIGALRM handler: $!\n"; =item Signals as "faults" End of Patch.