Skip to content

Commit

Permalink
Add latest constant for select
Browse files Browse the repository at this point in the history
  • Loading branch information
rruuaanng committed Dec 1, 2024
1 parent d9331f1 commit e1f1837
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 37 deletions.
78 changes: 41 additions & 37 deletions Doc/library/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,43 +280,47 @@ Edge and Level Trigger Polling (epoll) Objects

*eventmask*

+-------------------------+-----------------------------------------------+
| Constant | Meaning |
+=========================+===============================================+
| :const:`EPOLLIN` | Available for read |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLOUT` | Available for write |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLPRI` | Urgent data for read |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLERR` | Error condition happened on the assoc. fd |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
| | Level Trigger behavior |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
| | pulled out, the fd is internally disabled |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLEXCLUSIVE` | Wake only one epoll object when the |
| | associated fd has an event. The default (if |
| | this flag is not set) is to wake all epoll |
| | objects polling on a fd. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDHUP` | Stream socket peer closed connection or shut |
| | down writing half of connection. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLRDBAND` | Priority data band can be read. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLWRBAND` | Priority data may be written. |
+-------------------------+-----------------------------------------------+
| :const:`EPOLLMSG` | Ignored. |
+-------------------------+-----------------------------------------------+
+---------------------------+-----------------------------------------------+
| Constant | Meaning |
+===========================+===============================================+
| :const:`EPOLLIN` | Available for read |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLOUT` | Available for write |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLPRI` | Urgent data for read |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLERR` | Error condition happened on the assoc. fd |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
| | Level Trigger behavior |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
| | pulled out, the fd is internally disabled |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLEXCLUSIVE` | Wake only one epoll object when the |
| | associated fd has an event. The default (if |
| | this flag is not set) is to wake all epoll |
| | objects polling on a fd. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDHUP` | Stream socket peer closed connection or shut |
| | down writing half of connection. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLRDBAND` | Priority data band can be read. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWRBAND` | Priority data may be written. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLMSG` | Ignored. |
+---------------------------+-----------------------------------------------+
| :const:`EPOLL_URING_WAKE` | Optimizes event wake-up using io_uring. | |
+---------------------------+-----------------------------------------------+
| :const:`EPOLLWAKEUP` | Prevents sleep during event waiting. | |
+---------------------------+-----------------------------------------------+

.. versionadded:: 3.6
:const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add the ``EPOLL_URING_WAKE``, ``EPOLLWAKEUP`` constants to the :mod:`select`
module.
6 changes: 6 additions & 0 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,12 @@ _select_exec(PyObject *m)
#ifdef EPOLLMSG
ADD_INT(EPOLLMSG);
#endif
#ifdef EPOLL_URING_WAKE
ADD_INT(EPOLL_URING_WAKE);
#endif
#ifdef EPOLLWAKEUP
ADD_INT(EPOLLWAKEUP);
#endif

#ifdef EPOLL_CLOEXEC
ADD_INT(EPOLL_CLOEXEC);
Expand Down

0 comments on commit e1f1837

Please sign in to comment.