From owner-freebsd-hackers Sun Oct 8 15:34:41 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA14481 for hackers-outgoing; Sun, 8 Oct 1995 15:34:41 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA14475 for ; Sun, 8 Oct 1995 15:34:39 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id PAA07347; Sun, 8 Oct 1995 15:32:45 -0700 From: Terry Lambert Message-Id: <199510082232.PAA07347@phaeton.artisoft.com> Subject: Re: FIFO stuff To: bde@zeta.org.au (Bruce Evans) Date: Sun, 8 Oct 1995 15:32:45 -0700 (MST) Cc: FreeBSD-Hackers@FreeBSD.ORG, chuckr@eng.umd.edu In-Reply-To: <199510072139.HAA03662@godzilla.zeta.org.au> from "Bruce Evans" at Oct 8, 95 07:39:00 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2161 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > >I looked at the finger source, and the .plan file is checked to see if > >it's there, and if it's non-zero length. OK, I got it to check if it was > >a fifo, and if it was, not do the non-zero length check, but reading the > >fifo seems to be a problem. Finger wants to do a character by character > >read, and check if any of the returns are EOF. Since it may do a read > >before masterplan has genned a new response file, it gets this EOF before > >the masterplan program has had time to respond. > > Just reading it should work. The open should block until something > writes the the fifo, and read should not return 0 until the fifo is not > open for writing by any process. .plan must remain a fifo throughout. > I don't think this can be made to work properly if masterplan replaces > .plan with a fifo on the fly. I believe the problem is that a non-blocking open on a FIFO fails to cause the use of non-blocking reads. I put one patch up for this, but it was insufficient (I noted this in the patch at the time). It would require me setting up a testbed to crrect this problem, and my current machine resources are all committed (I don't have room for all of Masterplan). I also do not have time to tract the FIFOFS problems further, other than to acknowledge that yes, according to the code, that is correct behaviour. Clearly, it's not what Masterplan expects, and it may in fact require a reimplementation of the FIFO code to fix. I plan on waiting on doing *anything* like this until the struct fileops bogosity is removed from /sys/sys/file.h. This will take some cleanup on several file systems, notable specfs. Hopefully specfs will be dying in any case, to be replaced in all instances by symlinks to a permanently mounted devfs. That would make the necessary POSIX domain socket code repairs (probably a rewrite) on which the FIFO code is implemented a lot simpler. Unless someone wants to take this on now, it's probably something that will require a kludge patch to make work. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.