Use php_pollfd_for_ms more consistently for single fd polling#22872
Use php_pollfd_for_ms more consistently for single fd polling#22872NattyNarwhal wants to merge 4 commits into
php_pollfd_for_ms more consistently for single fd polling#22872Conversation
This is only used on pre-libpq 17.
This also handles the case where poll isn't available (does that even matter nowadays?)
a7fb0fc to
588fe59
Compare
FWIW looked into this further and there are only a few places where select(2) is called that outside of fallbacks if poll(2) isn't present (vendored libmagic, mysqlnd for |
There's a few cases where we call
pollwith a single fd; we have a wrapper (php_pollfd_for_ms) to make this case cleaner with less boilerplate.Side note: said wrapper also uses the
php_poll2API, which can also emulate poll(2) using select(2); FastCGI was doing this on its own, so that also handles that case. That said, poll seems to be basically everywhere nowadays, so emulating poll is only seems useful for Windows, which hasWSAPoll. I suspectphp_poll2should be aWSAPollwrapper instead? The new poll API handles all this of course, but seems pretty heavyweight for the case of just quickly polling a single fd.