On Sat, 13 Jun 2020 10:05:19 +0200, Martin Pieuchot wrote:

> Diff below extends the existing kqfilter handlers to be able to set
> POLLHUP in the new poll(2) implementation.  
>
> __EV_HUP is introduced and now set for this purpose.  A new kqfilter
> for deadfs is introduced to match the existing poll handler.

OK.  I wonder if POLLERR is actually more appropriate for this but
I understand you are just matching existing behavior at this point.

> __EV_HUP is not exactly like EV_EOF.  Very few handlers set POLLHUP so
> this approach is conservative.

Right, there are some subtle differences.

> __EV_HUP reuses the EV_FLAG1 flag which isn't used for `file_filtops'.
> We could decided to set it only if __EV_POLL is set which should ensure
> it is not exported to userland.  Is it desirable?

I think that would be safest.

Once this is complete we may want to compare our poll support to
other systems.  I suspect we do things differently for some of the
corner cases.  For example, how we handle the write end of a pipe
that has had its read end closed looks difference thant, say, Linux.
Of course that is out of scope for now.

 - todd

Reply via email to