From owner-freebsd-current Tue Sep 5 10:25:26 2000 Delivered-To: freebsd-current@freebsd.org Received: from dataloss.net (ppp0.knz.ams.dataloss.net [212.189.231.51]) by hub.freebsd.org (Postfix) with SMTP id 8879A37B422 for ; Tue, 5 Sep 2000 10:25:23 -0700 (PDT) Received: (qmail 1601 invoked by uid 1000); 5 Sep 2000 17:24:59 -0000 Mail-Followup-To: current@freebsd.org Date: Tue, 5 Sep 2000 19:24:58 +0200 From: Peter van Dijk To: current@freebsd.org Subject: Re: FIFOs & select: what about our implementation? Message-ID: <20000905192458.A1428@dataloss.net> References: <20000905195056.A67326@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20000905195056.A67326@nagual.pp.ru>; from ache@nagual.pp.ru on Tue, Sep 05, 2000 at 07:50:56PM +0400 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Sep 05, 2000 at 07:50:56PM +0400, Andrey A. Chernov wrote: > Consider this comment comes from screen(1): > > /* > * Define this if your system exits select() immediatly if a pipe is > * opened read-only and no writer has opened it. > */ > #define BROKEN_PIPE 1 > > We have broken(?) pipe, according to this statement. At least, we have > select return code -1 with wrong errno == 0. qmail calls this 'named pipe bug 1'. The workaround (which screen probably uses too) is to let the process doing the select() also have one fd opened for writing on the pipe. With that write-open, select() will only return if there is actual data waiting inside the pipe. I have filed a PR (19871) for this I think about 2 months ago, somebody submitted a patch but I never gotten around to testing it. I surely do think this behaviour is broken. http://www.freebsd.org/cgi/query-pr.cgi?pr=19871 Greetz, Peter -- dataloss networks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message