#!./perl
BEGIN {
chdir 't' if -d 't';
}
# Don't do anything if POSIX is missing, or sigaction missing.
use Config;
eval 'use POSIX';
print "1..0\n";
exit 0;
}
}
use strict;
$^W=1;
print "1..25\n";
$bad7=1;
}
$bad18=1;
}
$ok=1;
}
{
my $bad;
}
{ print "ok 4\n" } else { print "not ok 4\n"}
{ print "ok 5\n" } else { print "not ok 5\n"}
print "ok 6 # Skip: sigaction() thinks different in $^O\n";
} else {
print "not ok 6\n";
}
} else {
print "ok 6\n";
}
kill 'HUP', $$;
{
local($^W)=0;
kill 'HUP', $$;
}
# Make sure the signal mask gets restored after sigaction croak()s.
eval {
};
kill 'HUP', $$;
# Make sure the signal mask gets restored after sigaction returns early.
kill 'HUP', $$;
eval {
};
print $@ ? "not ok 15\n" : "ok 15\n";
eval {
};
print $@ ? "not ok 16\n" : "ok 16\n";
eval {
};
print $@ ? "ok 17\n" : "not ok 17\n";
print "ok 18 # Skip: SIGCONT not trappable in $^O\n";
} else {
{
local($^W)=0;
kill 'CONT', $$;
}
}
}
{
my $hup20;
my $hup21;
print "ok 19\n"; # no coredump, still alive
kill "HUP", $$;
kill "HUP", $$;
}
# "safe" attribute.
# for this one, use the accessor instead of the attribute
# standard signal handling via %SIG is safe
$oldaction = POSIX::SigAction->new;
# SigAction handling is not safe ...
# ... unless we say so!
# And safe signal delivery must work
$ok = 0;
kill 'HUP', $$;