From owner-svn-src-all@FreeBSD.ORG Sun May 23 05:18:57 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA9F1065672; Sun, 23 May 2010 05:18:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB1A8FC16; Sun, 23 May 2010 05:18:56 +0000 (UTC) Received: from c122-107-114-249.carlnfd1.nsw.optusnet.com.au (c122-107-114-249.carlnfd1.nsw.optusnet.com.au [122.107.114.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o4N5Iqf9031410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 May 2010 15:18:53 +1000 Date: Sun, 23 May 2010 15:18:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Konstantin Belousov In-Reply-To: <201005211036.o4LAaUXV090349@svn.freebsd.org> Message-ID: <20100523145531.M13483@delplex.bde.org> References: <201005211036.o4LAaUXV090349@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208374 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 05:18:57 -0000 On Fri, 21 May 2010, Konstantin Belousov wrote: > Log: > Remove PIOLLHUP from the flags used to test for to set exceptfsd > fd_set bits in select(2). It seems that historical behaviour is to not > reporting exception on EOF, and several applications are broken. > > Reported by: Yoshihiko Sarumaru > Discussed with: bde Er, the discussion pointed out that this change has no effect (except possibly for bugs). > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Fri May 21 09:52:49 2010 (r208373) > +++ head/sys/kern/sys_generic.c Fri May 21 10:36:29 2010 (r208374) > @@ -996,7 +996,7 @@ done: > static int select_flags[3] = { > POLLRDNORM | POLLHUP | POLLERR, > POLLWRNORM | POLLHUP | POLLERR, > - POLLRDBAND | POLLHUP | POLLERR > + POLLRDBAND | POLLERR > }; > > /* > POLLHUP and POLLHUP are output-only, so their use as input flags here is nonsense on all 3 lines. This nonsense has no effect as far as I can see, since nonsensical input flags are ignored. POLLHUP is still set unconditionally (if hangup actually occurs) for all 3 channels, and this conflicts with the historical misbehaviour for the exceptfds channel. POLLHUP can be suppressed by POLLINIGNEOF. Using POLLINIGNEOF on the 3rd channel onnel seems to work right here, although POLLINIGNEOF's name indicates that it should not -- as its name suggests, POLLINIGNEOF was intended to only cause EOF to be ignored for the input channel, and it may have actually done that, but it now applies to all channels. This doesn't matter for select() since there is a separate poll at the lowest level each channel, but for poll() there is normally only 1 poll at the lowest level, and in any case userland cannot influence the misapplication of POLLINIGNEOF to a non-input event, and anyway^2 poll()'s semantics require it to set POLLHUP even if there the input mask of events is empty, so poll()'s channels are inseparable for POLLHUP. The style bugs (4-char primary indentation) remain. Bruce