develooper Front page | perl.perl5.porters | Postings from July 2001

Re: sigaction.t under QNX

From:
Norton Allen
Date:
July 5, 2001 09:14
Subject:
Re: sigaction.t under QNX
Message ID:
200107051621.MAA12193@bottesini.harvard.edu
Norton Allen wrote:
> Under QNX, I am getting a failure on ext/POSIX/sigaction.t
> subtest 13. The signal mask is not being properly restored
> when sigaction returns early. I am happy to pursue and
> patch for this, but I could really use some guidance.
> 
> Apparently the plan is for POSIX.xs:1218:
> 
>   SAVEDESTRUCTOR(restore_sigmask, &osset);
> 
> to take care of this, but it also appears that this is
> not the mechanism used when sigaction does not return
> early.
> 
> How does SAVEDESTRUCTOR work?

  OK, it appears that the destructor saved with SAVEDESTRUCTOR
  is not executed until after the function has returned.
  Unfortunately osset is a *local* variable, so it is long
  out of scope and we're sending garbage to restore_sigmask
  and hence to sigprocmask.
  
  This requires a patch to ext/POSIX/POSIX.xs to make osset
  some sort of static variable. What is the right way to do
  this in XS? A pointer to any example would be most helpful.
  
   -Norton Allen
   



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About