Date: Sun, 23 May 2010 15:18:52 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Konstantin Belousov <kib@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r208374 - head/sys/kern Message-ID: <20100523145531.M13483@delplex.bde.org> In-Reply-To: <201005211036.o4LAaUXV090349@svn.freebsd.org> References: <201005211036.o4LAaUXV090349@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ysarumaru gmail com> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100523145531.M13483>