polling icon indicating copy to clipboard operation
polling copied to clipboard

On kqueue platforms, make it so the EV_EOF flag corresponds to the "is_interrupt" flag.

Open notgull opened this issue 1 year ago • 3 comments

Closes #213

notgull avatar Dec 04 '24 01:12 notgull

Can you point to any documentation / man-page or mailing list post which proves this? I couldn't find anything indicating this association in kqueue(2) of FreeBSD 14.2. (It is of course still a good idea to be able to specify the flag, I just don't see why this is termed "interrupt"; on the other hand, relation to HUP is a bit stronger, because it gets emitted when the end of the stream is reached, e.g. because all writers of a FIFO or such closed)

fogti avatar Dec 08 '24 21:12 fogti

I swear that I saw some code using it like this, but I can't seem to find it now. Standby.

notgull avatar Dec 13 '24 00:12 notgull

From https://man.freebsd.org/cgi/man.cgi?kqueue(2):

If the read direction of the socket has shut- down, then the filter also sets EV_EOF in flags, and returns the socket error (if any) in fflags. It is possible for EOF to be returned (indicating the connection is gone) while there is still data pending in the socket buffer.

Typically, EV_EOF indicates that a socket has been shut down by a peer. See its application in https://eradman.com/posts/kqueue-tcp.html https://nima101.github.io/kqueue_server

From what I can tell, it looks pretty similar to EPOLLHUP in that regard.

vkrivopalov avatar Oct 16 '25 09:10 vkrivopalov