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

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


commit 53d4153b999bfc39e687146dc48f39b6b5ba4f9b
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/53d4153b999bfc39e687146dc48f39b6b5ba4f9b


-- 
DragonFly BSD source repository



More information about the Commits mailing list