From owner-freebsd-net Fri Dec 21 6:27:43 2001 Delivered-To: freebsd-net@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id AA98137B41B; Fri, 21 Dec 2001 06:27:34 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id BAA08565; Sat, 22 Dec 2001 01:27:29 +1100 Date: Sat, 22 Dec 2001 01:27:32 +1100 (EST) From: Bruce Evans X-X-Sender: To: Alfred Perlstein Cc: , , , Subject: Re: fifo fix (Re: cvs commit: src/sys/fs/fifofs fifo_vnops.c) In-Reply-To: <20011218111531.A59831@elvis.mu.org> Message-ID: <20011222011614.C4869-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, 18 Dec 2001, Alfred Perlstein wrote: > > * Bruce Evans [011217 07:10] wrote: > > > I'm not happy with frobbing the socket state. I suggest frobbing the > > > events mask instead. Either use a flag to tell sopoll() to ignore > > > SS_CANTRCVMORE, or use new events POLLIN_IGNORE_EOF and > > > POLLRDNORM_IGNORE_EOF (convert the userland POLLIN/POLLRDNORM to these > > > and change sopoll() to support them). > > Wait, please clarify, are you suggesting that POLLIN_IGNORE_EOF > and POLLRDNORM_IGNORE_EOF must be used by userland applications? > Or would it be an internal flag for the kernel so that here you'd > see something like: > > filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock; > if (filetmp.f_data) { > if (ap->a_events & ~POLLIN) > ap->a_events |= POLLIN_IGNORE_EOF; I think it should be more like: if (ap->a_events & POLLIN) ap->a_events = (ap->a_events & ~POLLIN) | POLLIN_IGNORE_EOF; We can't pass in flags that we don't really care about (POLLIN in this case) since they will cause side effects (selrecord()...). I might actually use a new variable instead of changing `ap'. > /* same for POLLRDNORM */ > revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred, > ap->a_td); Add something like: if (revents & POLLIN_IGNORE_EOF) revents = (revents & ~POLLIN_IGNORE_EOF) | POLLIN; > } > > Or that the userland will just OR in POLLIN_IGNORE_EOF before calling > poll(2). > > I'm not sure if I like the latter way of fixing things. Userland might want to do this someday. I would just make it easy for it to do so. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message