changeset: 102408:d87f30c29ad4 user: Berker Peksag date: Tue Jul 19 21:09:26 2016 +0300 files: Doc/library/select.rst Misc/NEWS Modules/selectmodule.c description: Issue #27567: Expose the POLLRDHUP constant in the select module diff -r 77154b3fcd20 -r d87f30c29ad4 Doc/library/select.rst --- a/Doc/library/select.rst Mon Jul 18 22:08:19 2016 -0700 +++ b/Doc/library/select.rst Tue Jul 19 21:09:26 2016 +0300 @@ -391,6 +391,9 @@ +-------------------+------------------------------------------+ | :const:`POLLHUP` | Hung up | +-------------------+------------------------------------------+ + | :const:`POLLRDHUP`| Stream socket peer closed connection, or | + | | shut down writing half of connection | + +-------------------+------------------------------------------+ | :const:`POLLNVAL` | Invalid request: descriptor not open | +-------------------+------------------------------------------+ diff -r 77154b3fcd20 -r d87f30c29ad4 Misc/NEWS --- a/Misc/NEWS Mon Jul 18 22:08:19 2016 -0700 +++ b/Misc/NEWS Tue Jul 19 21:09:26 2016 +0300 @@ -28,7 +28,8 @@ - Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select module. -- Issue #27567: Expose the EPOLLRDHUP constant in the select module. +- Issue #27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select + module. - Issue #1621: Avoid signed int negation overflow in the "audioop" module. diff -r 77154b3fcd20 -r d87f30c29ad4 Modules/selectmodule.c --- a/Modules/selectmodule.c Mon Jul 18 22:08:19 2016 -0700 +++ b/Modules/selectmodule.c Tue Jul 19 21:09:26 2016 +0300 @@ -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 @@ -2452,6 +2456,10 @@ #ifdef POLLMSG PyModule_AddIntMacro(m, POLLMSG); #endif +#ifdef POLLRDHUP + /* Kernel 2.6.17+ */ + PyModule_AddIntMacro(m, POLLRDHUP); +#endif } #endif /* HAVE_POLL */