summaryrefslogtreecommitdiff
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-07-19 21:09:26 +0300
committerBerker Peksag <berker.peksag@gmail.com>2016-07-19 21:09:26 +0300
commitcd4990ad718b8bcdb3c0781cec94f2509c382f61 (patch)
treed9d17566e93565d419668e67cb5e818ef01c58fa /Modules/selectmodule.c
parent9ea6b8e5b89957a86ec4339ee7fee94f6ad5289a (diff)
downloadcpython-cd4990ad718b8bcdb3c0781cec94f2509c382f61.tar.gz
Issue #27567: Expose the POLLRDHUP constant in the select module
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index c84c3cc26b..0f90ce259a 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -4,6 +4,10 @@
have any value except INVALID_SOCKET.
*/
+#if defined(HAVE_POLL_H) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+
#include "Python.h"
#include <structmember.h>
@@ -2452,6 +2456,10 @@ PyInit_select(void)
#ifdef POLLMSG
PyModule_AddIntMacro(m, POLLMSG);
#endif
+#ifdef POLLRDHUP
+ /* Kernel 2.6.17+ */
+ PyModule_AddIntMacro(m, POLLRDHUP);
+#endif
}
#endif /* HAVE_POLL */