On Fri, 22 Oct 2021 14:25:18 +0100, Martin Pieuchot wrote: > Last year we added the new EVFILT_EXCEPT filter type to kqueue in > order to report conditions currently available via POLLPRI/POLLRDBAND > in poll(2) and select(2). > > This new filter has been implemented in tty and socket by re-using the > existing kqueue's "read" filter. This has a downside which is the filter > will also trigger if any data is available for reading. > > This "feature" makes it impossible to correctly implement poll(2)'s > "empty" condition mode. If no bit are set in the `events' pollfd > structure we still need to return POLLHUP. But if the filter triggers > when there's data to read, it means POLLIN not POLLHUP. > > So I'd like to change the existing EVFILT_EXCEPT filters to no longer > fire if there is something to read. Diff below does that and adds a > new filter for FIFOs necessary for poll(2) support.
This looks good to me. Separating out the OOB from the read filter is a nice bonus. - todd