Use rb_thread_fd_select instead of select(2) (#12292)
Use rb_thread_fd_select instead of select(2)
For fixing https://bugs.ruby-lang.org/issues/20932 . TCPSocket.new, which internally uses select(2) for HEv2, can cause SEGV if the number of file descriptors exceeds FD_SETSIZE.
This change avoids that issue by replacing select(2) with rb_thread_fd_select, which is provided as part of Ruby's internal API.
Use
rb_thread_fd_selectinstead of select(2) (#12292)rb_thread_fd_selectinstead of select(2)For fixing https://bugs.ruby-lang.org/issues/20932 .
TCPSocket.new, which internally uses select(2) for HEv2, can cause SEGV if the number of file descriptors exceedsFD_SETSIZE.This change avoids that issue by replacing select(2) with
rb_thread_fd_select, which is provided as part of Ruby's internal API.This includes the following changes.