It may work currently for Linux (which, I understand, is our only poll code-path for now), but we can't just look at one impl and assume that's how poll works. For example, additionally subscribing to POLLRDHUP on Linux brings us closer to other impls, as it causes us to skip the read queue for more HUP events.
Sorry, that does not make sense to me. We are not looking to remodel our entire socket implementation in this PR, but to fix a bug in a backportable manner, without introducing regressions. Testing for regressions on the one platform we support appears to me like an appropriate way to check this.
And what do you mean just looking at one impl? I'm looking at the implementation of the Linux kernel, which is what's relevant for us. We are already relying on their behaviour being consistent, and given their concerns about not breaking user space, it seems extremely unlikely that they would suddenly change how poll() works.
And how is adding new subscription relevant for this bug fix? I understand we may want to overhaul our socket implementation to make it consistent, documented, understandable and document its invariants, and i'm on board with that, but it seems to me orthogonal to what we are trying to achieve in this PR. It's akin to if i was objecting to Sjors' alternative by saying "yeah but what if we had the code this way instead?" -- well yeah it would break, the code is written for the current logic, not another one that doesn't currently exist.
Now i agree we want to take all this into account for the big refactor of switching all our platforms to use poll() and be consistent with each others. But it seems we are talking past each other here, where i'm trying to fix the bug on older versions, and you object because it's not the best first step for a complete overhaul.