Patch #1583 by Adam Olsen.
This adds signal.set_wakeup_fd(fd) which sets a file descriptor to
which a zero byte will be written whenever a C exception handler runs.
I added a simple C API as well, PySignal_SetWakeupFd(fd).
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index a6ee840..73a0e36 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -238,6 +238,9 @@
PyAPI_FUNC(int) PyErr_CheckSignals(void);
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
+/* In signalmodule.c */
+int PySignal_SetWakeupFd(int fd);
+
/* Support for adding program text to SyntaxErrors */
PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);