From owner-freebsd-net Tue Dec 18 9:15:50 2001 Delivered-To: freebsd-net@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 53CA937B405; Tue, 18 Dec 2001 09:15:37 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id C47B481E0F; Tue, 18 Dec 2001 11:15:31 -0600 (CST) Date: Tue, 18 Dec 2001 11:15:31 -0600 From: Alfred Perlstein To: Bruce Evans Cc: wollman@FreeBSD.org, net@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: fifo fix (Re: cvs commit: src/sys/fs/fifofs fifo_vnops.c) Message-ID: <20011218111531.A59831@elvis.mu.org> References: <20011215151025.A82439@elvis.mu.org> <20011217230720.N13599-100000@gamplex.bde.org> <20011217122953.G82439@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011217122953.G82439@elvis.mu.org>; from alfred@FreeBSD.org on Mon, Dec 17, 2001 at 12:29:53PM -0600 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 * Alfred Perlstein [011217 12:47] wrote: > * Bruce Evans [011217 07:10] wrote: > > > > + > > > filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock; > > > + so = (struct socket *)filetmp.f_data; > > > + s = splnet(); > > > + oflg = so->so_state & SS_CANTRCVMORE; > > > + if (ap->a_vp->v_fifoinfo->fi_writers == 0) > > > + so->so_state &= ~SS_CANTRCVMORE; > > > if (filetmp.f_data) > > > revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred, > > > ap->a_td); > > > + so->so_state |= oflg; > > > + splx(s); > > > > 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; /* same for POLLRDNORM */ revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred, ap->a_td); } 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. thanks, -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message