git: kernel - Implement POLLHUP for pipes and filesystem fifos (4)

Matthew Dillon dillon at crater.dragonflybsd.org
Thu May 13 11:08:11 PDT 2021


commit 26a9aa6b9361c062c2a585933c6aeb76243b4887
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu May 13 11:03:39 2021 -0700

    kernel - Implement POLLHUP for pipes and filesystem fifos (4)
    
    * pipes need the same shutdown-vs-closed treatment.  Only trigger
      POLLHUP when the other end is closed.  Do not trigger POLLHUP
      when the other end issues a shutdown(..SHUT_WR).
    
    * NOTE: Linux does not support shutdown() on pipes because linux
      pipes are half-duplex.  BSD pipes are full-duplex and shutdown()
      makes more sense.  That said, make shutdown()'s POLLHUP behavior
      uniform across the board... meaningthat shutdown() does NOT trigger
      POLLHUP, only a complete close().
    
      This is important because I suspect linux programmers might use
      POLLHUP to try to detect unexpected terminations, whereas a
      shutdown() is par for the course when communications are being
      shut-down in an expected manner.

Summary of changes:
 sys/kern/sys_pipe.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/26a9aa6b9361c062c2a585933c6aeb76243b4887


-- 
DragonFly BSD source repository



More information about the Commits mailing list