[issue32568] Fix handling of sizehint=-1 in select.epoll()

STINNER Victor report at bugs.python.org
Fri Jun 22 10:06:26 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

> Also sizehint=0 was rejected before 2fb9ae9dfc5a6830d902332ba93b13387e292ddb. Now it is accepted.

DESCRIPTION
       epoll_create() creates a new epoll(7) instance.  Since Linux 2.6.8, the
       size argument is ignored, but must be  greater  than  zero;  see  NOTES
       below.

(...)

NOTES
       In  the  initial  epoll_create()  implementation,  the  size   argument
       informed  the  kernel of the number of file descriptors that the caller
       expected to add to the epoll instance.  The kernel used  this  informa‐
       tion  as a hint for the amount of space to initially allocate in inter‐
       nal data structures describing events.  (If necessary, the kernel would
       allocate  more  space  if the caller's usage exceeded the hint given in
       size.)  Nowadays, this hint is no longer required (the  kernel  dynami‐
       cally sizes the required data structures without needing the hint), but
       size must still be greater than zero, in order to ensure backward  com‐
       patibility when new epoll applications are run on older kernels.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32568>
_______________________________________


More information about the Python-bugs-list mailing list