code if this is zero or less, the signal was sent by
a user process and the uid and pid make sense,
otherwise the signal was sent by the kernel
+
+The following are also defined by POSIX/SUSv3, but unfortunately
+not very widely implemented:
+
pid the process id generating the signal
uid the uid of the process id generating the signal
status exit value or signal for SIGCHLD
eval 'use POSIX qw(SA_SIGINFO); SA_SIGINFO';
skip("no SA_SIGINFO", 1) if $@;
sub hiphup {
- is($_[1]->{pid}, $$, "SA_SIGINFO got right pid");
+ is($_[1]->{signo}, 1, "SA_SIGINFO got right signal");
}
my $act = POSIX::SigAction->new('hiphup', 0, SA_SIGINFO);
sigaction(SIGHUP, $act);
hv_store(sih, "signo", 5, newSViv(sip->si_signo), 0);
hv_store(sih, "code", 4, newSViv(sip->si_code), 0);
hv_store(sih, "errno", 5, newSViv(sip->si_errno), 0);
+#if 0 /* XXX TODO: Configure scan for the existence of these, but even that does not help if the SA_SIGINFO is not implemented according to the spec. */
+ hv_store(sih, "status", 6, newSViv(sip->si_status), 0);
hv_store(sih, "uid", 3, newSViv(sip->si_uid), 0);
hv_store(sih, "pid", 3, newSViv(sip->si_pid), 0);
hv_store(sih, "addr", 4, newSVuv(PTR2UV(sip->si_addr)), 0);
- hv_store(sih, "status", 6, newSViv(sip->si_status), 0);
hv_store(sih, "band", 4, newSViv(sip->si_band), 0);
+#endif
EXTEND(SP, 2);
PUSHs((SV*)rv);
PUSHs(newSVpv((void*)sip, sizeof(*sip)));