]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127481: Add `EPOLLWAKEUP` to the `select` module (GH-127482)
authorRUANG (James Roy) <longjinyii@outlook.com>
Wed, 4 Dec 2024 13:30:38 +0000 (21:30 +0800)
committerGitHub <noreply@github.com>
Wed, 4 Dec 2024 13:30:38 +0000 (14:30 +0100)
Doc/library/select.rst
Misc/NEWS.d/next/Library/2024-12-01-23-18-43.gh-issue-127481.K36AoP.rst [new file with mode: 0644]
Modules/selectmodule.c

index f23a249f44b485f8aa0694ed8fd4a781d7358d07..4fcff9198944a8e46107125e5c7f90f00aaf1c2b 100644 (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.
diff --git a/Misc/NEWS.d/next/Library/2024-12-01-23-18-43.gh-issue-127481.K36AoP.rst b/Misc/NEWS.d/next/Library/2024-12-01-23-18-43.gh-issue-127481.K36AoP.rst
new file mode 100644 (file)
index 0000000..8ada0b5
--- /dev/null
@@ -0,0 +1 @@
+Add the ``EPOLLWAKEUP`` constant to the :mod:`select` module.
index 6ced71cca73178eb4f44827848debed825cb68df..e14e114a6dafd0a1c6bb96e427f78f92f8e66ec1 100644 (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);