summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-02-25 07:46:53 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-02-25 07:46:53 +0000
commit16bd9a85dbc3be76d00459adeafa5bf918a5212d (patch)
tree9eeb5cf0099d530ca8657d1d1d9b62f621554e31 /perl.h
parent25da442874cf6136cfd7e0a24430b1ec13c17197 (diff)
downloadperl-16bd9a85dbc3be76d00459adeafa5bf918a5212d.tar.gz
Cleanup #18770 as suggested by Rafael.
p4raw-id: //depot/perl@18771
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index d03809aef1..d316734c2c 100644
--- a/perl.h
+++ b/perl.h
@@ -4201,6 +4201,36 @@ extern void moncontrol(int);
#define PERL_SIGNALS_UNSAFE_FLAG 0x0001
+/* From sigaction(2) (FreeBSD man page):
+ * | Signal routines normally execute with the signal that
+ * | caused their invocation blocked, but other signals may
+ * | yet occur.
+ * Emulation of this behavior (from within Perl) is enabled
+ * by defining PERL_BLOCK_SIGNALS.
+ */
+#define PERL_BLOCK_SIGNALS
+
+#if defined(HAS_SIGPROCMASK) && defined(PERL_BLOCK_SIGNALS)
+# define PERL_BLOCKSIG_ADD(set,sig) \
+ sigset_t set; sigemptyset(&(set)); sigaddset(&(set), sig)
+# define PERL_BLOCKSIG_BLOCK(set) \
+ sigprocmask(SIG_BLOCK, &(set), NULL)
+# define PERL_BLOCKSIG_UNBLOCK(set) \
+ sigprocmask(SIG_UNBLOCK, &(set), NULL)
+#endif /* HAS_SIGPROCMASK && PERL_BLOCK_SIGNALS */
+
+/* How about the old style of sigblock()? */
+
+#ifndef PERL_BLOCKSIG_ADD
+# define PERL_BLOCKSIG_ADD(set, sig) NOOP
+#endif
+#ifndef PERL_BLOCKSIG_BLOCK
+# define PERL_BLOCKSIG_BLOCK(set) NOOP
+#endif
+#ifndef PERL_BLOCKSIG_ADD
+# define PERL_BLOCKSIG_UNBLOCK(set) NOOP
+#endif
+
/* and finally... */
#define PERL_PATCHLEVEL_H_IMPLICIT
#include "patchlevel.h"