summaryrefslogtreecommitdiff
path: root/src/include/libpq
diff options
context:
space:
mode:
authorTom Lane2015-08-31 19:52:56 +0000
committerTom Lane2015-08-31 19:52:56 +0000
commitf333204bbcd32091311b070e8f8ab4717dd8cadf (patch)
tree38ccdfdc7f5dc7f805ed81989bc05ebb2db24881 /src/include/libpq
parent2c713d6ea29c91cd2cbd92fa801a61e55ea2a3c4 (diff)
Actually, it's not that hard to merge the Windows pqsignal code ...
... just need to typedef sigset_t and provide sigemptyset/sigfillset, which are easy enough.
Diffstat (limited to 'src/include/libpq')
-rw-r--r--src/include/libpq/pqsignal.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/include/libpq/pqsignal.h b/src/include/libpq/pqsignal.h
index 3364247531..7ba7e781f7 100644
--- a/src/include/libpq/pqsignal.h
+++ b/src/include/libpq/pqsignal.h
@@ -16,27 +16,24 @@
#include <signal.h>
#ifndef WIN32
-extern sigset_t UnBlockSig,
- BlockSig,
- StartupBlockSig;
-
#define PG_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL)
-#else /* WIN32 */
-/*
- * Windows doesn't provide the POSIX signal API, so we use something
- * approximating the old BSD signal API.
- */
-extern int UnBlockSig,
- BlockSig,
- StartupBlockSig;
+#else
+/* Emulate POSIX sigset_t APIs on Windows */
+typedef int sigset_t;
extern int pqsigsetmask(int mask);
#define PG_SETMASK(mask) pqsigsetmask(*(mask))
+#define sigemptyset(set) (*(set) = 0)
+#define sigfillset(set) (*(set) = ~0)
#define sigaddset(set, signum) (*(set) |= (sigmask(signum)))
#define sigdelset(set, signum) (*(set) &= ~(sigmask(signum)))
#endif /* WIN32 */
+extern sigset_t UnBlockSig,
+ BlockSig,
+ StartupBlockSig;
+
extern void pqinitmask(void);
#endif /* PQSIGNAL_H */