2 # Tests for signal emulation
8 # only used for skip_all, the forking confuses test.pl
13 unless ($^O =~ /^MSWin/) {
14 skip_all('windows specific test');
18 skip_all("requires compilation with the fork emulation")
19 unless $Config{'d_pseudofork'};
23 # manual test counting because the forks confuse test.pl
28 # find a safe signal, the implementation shouldn't be doing anything
29 # funky with NUMdd signals
30 my ($sig) = grep /^NUM/, split ' ', $Config{sig_name};
32 # otherwise, hope CONT is safe
41 unless (defined $pid) {
43 not ok 1 # fork failed: $!
51 print "ok 1 # pseudo-forked\n";
52 sleep 2; # give the child a chance to setup
61 print "ok 2 # $sig signal handler called\n";
68 while (!$signalled && ++$count < 10) {
71 print "# signaled after $count loops\n";
72 print $! != 0 ? "not " : "", "ok 3 # \$! preserved\n";
73 print $^E != 0 ? "not " : "", "ok 4 # \$^E preserved\n"
74 or print STDERR "# \$^E = ", 0+$^E, "\n";