Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe8d966

Browse files
committed
Issue #27567: Expose the POLLRDHUP constant in the select module
1 parent a1ea9c8 commit fe8d966

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

Doc/library/select.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ linearly scanned again. :c:func:`select` is O(highest file descriptor), while
391391
+-------------------+------------------------------------------+
392392
| :const:`POLLHUP` | Hung up |
393393
+-------------------+------------------------------------------+
394+
| :const:`POLLRDHUP`| Stream socket peer closed connection, or |
395+
| | shut down writing half of connection |
396+
+-------------------+------------------------------------------+
394397
| :const:`POLLNVAL` | Invalid request: descriptor not open |
395398
+-------------------+------------------------------------------+
396399

Misc/NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Library
2828

2929
- Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select module.
3030

31-
- Issue #27567: Expose the EPOLLRDHUP constant in the select module.
31+
- Issue #27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select
32+
module.
3233

3334
- Issue #1621: Avoid signed int negation overflow in the "audioop" module.
3435

Modules/selectmodule.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
have any value except INVALID_SOCKET.
55
*/
66

7+
#if defined(HAVE_POLL_H) && !defined(_GNU_SOURCE)
8+
#define _GNU_SOURCE
9+
#endif
10+
711
#include "Python.h"
812
#include <structmember.h>
913

@@ -2451,6 +2455,10 @@ PyInit_select(void)
24512455
#endif
24522456
#ifdef POLLMSG
24532457
PyModule_AddIntMacro(m, POLLMSG);
2458+
#endif
2459+
#ifdef POLLRDHUP
2460+
/* Kernel 2.6.17+ */
2461+
PyModule_AddIntMacro(m, POLLRDHUP);
24542462
#endif
24552463
}
24562464
#endif /* HAVE_POLL */

0 commit comments

Comments
 (0)