{
struct sigaction act, oact;
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return SIG_ERR;
+#endif
+
act.sa_handler = handler;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
{
struct sigaction act;
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return -1;
+#endif
+
act.sa_handler = handler;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
int
Perl_rsignal_restore(pTHX_ int signo, Sigsave_t *save)
{
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return -1;
+#endif
+
return sigaction(signo, save, (struct sigaction *)NULL);
}
Sighandler_t
Perl_rsignal(pTHX_ int signo, Sighandler_t handler)
{
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return SIG_ERR;
+#endif
+
return PerlProc_signal(signo, handler);
}
{
Sighandler_t oldsig;
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return SIG_ERR;
+#endif
+
sig_trapped = 0;
oldsig = PerlProc_signal(signo, sig_trap);
PerlProc_signal(signo, oldsig);
int
Perl_rsignal_save(pTHX_ int signo, Sighandler_t handler, Sigsave_t *save)
{
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return -1;
+#endif
*save = PerlProc_signal(signo, handler);
return (*save == SIG_ERR) ? -1 : 0;
}
int
Perl_rsignal_restore(pTHX_ int signo, Sigsave_t *save)
{
+#ifdef USE_ITHREADS
+ /* only "parent" interpreter can diddle signals */
+ if (PL_curinterp != aTHX)
+ return -1;
+#endif
return (PerlProc_signal(signo, *save) == SIG_ERR) ? -1 : 0;
}