gh-127481: Add `EPOLLWAKEUP` to the `select` module (GH-127482)

This commit is contained in:
RUANG (James Roy) 2024-12-04 21:30:38 +08:00 committed by GitHub
parent bc0f2e9459
commit 6bc3e830a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -317,11 +317,17 @@ Edge and Level Trigger Polling (epoll) Objects
+-------------------------+-----------------------------------------------+
| :const:`EPOLLMSG` | Ignored. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLWAKEUP` | Prevents sleep during event waiting. |
+-------------------------+-----------------------------------------------+
.. versionadded:: 3.6
:const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5
or later.
.. versionadded:: next
:const:`EPOLLWAKEUP` was added. It's only supported by Linux Kernel 3.5
or later.
.. method:: epoll.close()
Close the control file descriptor of the epoll object.

View File

@ -0,0 +1 @@
Add the ``EPOLLWAKEUP`` constant to the :mod:`select` module.

View File

@ -2715,6 +2715,10 @@ _select_exec(PyObject *m)
#ifdef EPOLLMSG
ADD_INT(EPOLLMSG);
#endif
#ifdef EPOLLWAKEUP
/* Kernel 3.5+ */
ADD_INT(EPOLLWAKEUP);
#endif
#ifdef EPOLL_CLOEXEC
ADD_INT(EPOLL_CLOEXEC);