DragonFly BSD
DragonFly commits List (threaded) for 2010-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: kernel - make POLLHUP conform better to OpenGroup


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Aug 2010 15:11:55 -0700 (PDT)

commit 9a5d20db2b31ebaf094a3cb60c7342b1026f2947
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Fri Aug 13 15:06:12 2010 -0700

    kernel - make POLLHUP conform better to OpenGroup
    
    * The poll() backend now only evaluates EV_EOF for EVFILT_WRITE, and
      generates a POLLHUP which is properly mutually exclusive with
      POLLWRNORM and POLLOUT.
    
      We do this even for a half-closed (write-side-closed) socket.
    
    * We no longer set POLLHUP for POLLRD* or POLLIN, instead relying on
      the userland doing the read() and checking the 0 result (which
      userland has always done historically).
    
      EV_EOF for EVFILT_READ cannot be used to set POLLHUP for POLLRD* or
      POLLIN because it could indicate a half-closed connection
      (read-side-closed) where writing is still allowed, which is a more
      common situation on sockets.
    
      We would have to add another EV_ flag to set POLLHUP for POLLRD* or
      POLLIN to detect the fully disconnected state.  The OpenGroup standard
      does allow POLLHUP to be mixed with POLLRD* or POLLIN but for now we
      just don't set it at all in that case.
    
      Only a POLLOUT/POLLWRNORM flag request can cause POLLHUP to be set
      for now.

Summary of changes:
 sys/kern/sys_generic.c |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9a5d20db2b31ebaf094a3cb60c7342b1026f2947


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]