HomeFreeBSD

Fix handling of EV_EOF for named pipes.

Description

Fix handling of EV_EOF for named pipes.

Contrary to the kevent man page, EV_EOF on a fifo is not cleared by
EV_CLEAR. Modify the read and write filters to clear EV_EOF when the
fifo's PIPE_EOF flag is clear, and update the man page to document the
new behaviour.

Modify the write filter to return the amount of buffer space available
even if no readers are present. This matches the behaviour for sockets.

When reading from a pipe, only call pipeselwakeup() if some data was
actually read. This prevents the continuous re-triggering of a
EVFILT_READ event on EOF when in edge-triggered mode.

PR: 203366, 224615
Submitted by: Jan Kokemüller <jan.kokemueller@gmail.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24528

Details

Provenance
markjAuthored on
Differential Revision
D24528: Some fixes for FIFOs/pipes when used with kqueue/poll
Parents
rS360379: Call pipeselwakeup() after toggling PIPE_EOF.
Branches
Unknown
Tags
Unknown