From: Jarkko Hietaniemi Date: Thu, 21 Jul 2005 18:33:22 +0000 (+0300) Subject: Re: [PATCH] support POSIX SA_SIGINFO X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=79dec0f47660bf63141eb6171dd4c2d4053422af;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] support POSIX SA_SIGINFO Message-ID: <42DFC042.1090201@gmail.com> p4raw-id: //depot/perl@25207 --- diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod index e7166a6..78557da 100644 --- a/ext/POSIX/POSIX.pod +++ b/ext/POSIX/POSIX.pod @@ -1140,6 +1140,10 @@ semantics, as defined by POSIX/SUSv3: 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 diff --git a/ext/POSIX/t/sigaction.t b/ext/POSIX/t/sigaction.t index 6de6cfb..d0ff595 100644 --- a/ext/POSIX/t/sigaction.t +++ b/ext/POSIX/t/sigaction.t @@ -195,7 +195,7 @@ SKIP: { 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); diff --git a/mg.c b/mg.c index e9faf1b..f3e6720 100644 --- a/mg.c +++ b/mg.c @@ -2713,11 +2713,13 @@ Perl_sighandler(int sig) 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)));