From owner-freebsd-arch Sat Oct 27 3:36: 2 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mta06-svc.ntlworld.com (mta06-svc.ntlworld.com [62.253.162.46]) by hub.freebsd.org (Postfix) with ESMTP id 01A8937B403; Sat, 27 Oct 2001 03:36:00 -0700 (PDT) Received: from jaffacakes.freeserve.co.uk ([62.253.132.241]) by mta06-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20011027103558.HLZA13652.mta06-svc.ntlworld.com@jaffacakes.freeserve.co.uk>; Sat, 27 Oct 2001 11:35:58 +0100 Received: (from simonm@localhost) by jaffacakes.freeserve.co.uk (8.11.6/8.11.2) id f9RAZqT03278; Sat, 27 Oct 2001 11:35:52 +0100 (BST) (envelope-from simonm) To: Bill Fenner Cc: bde@zeta.org.au, rwatson@FreeBSD.ORG, bright@mu.org, arch@FreeBSD.ORG Subject: Re: Behavior of select() on pipes References: <200110262123.OAA13087@windsor.research.att.com> From: Simon Marlow Date: 27 Oct 2001 11:35:52 +0100 In-Reply-To: Bill Fenner's message of "Fri, 26 Oct 2001 14:23:17 -0700" Message-ID: Lines: 27 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bill Fenner writes: > But the standard behavior makes O_NONBLOCK FIFOs relatively useless; > once you open it for read you have no way to find out when a writer > arrives without blocking. You have to become a writer yourself, which > may limit the usefulness of permissions on the FIFO (e.g. an rw-r----- > FIFO for messages from fenner to group foo; anyone in group foo could > become the reader but it's impossible for them to open for writing to > get around this behavior). I'd just like to second that. I've had particular problesm with FIFOs on FreeBSD in the threaded runtime system for our Haskell compiler (lang/ghc). The runtime system opens everything O_NONBLOCK, and manages blocking and thread scheduling internally, pretty much like libc_r I imagine. We have to tell people to open FIFOs in read/write mode on FreeBSD to work around this behaviour. (incidentally, doesn't libc_r have this problem?) FreeBSD might be correct w.r.t. the POSIX spec, but I think this is one of those cases where you've just got to admit that the behaviour mandated by the spec isn't useful. Cheers, Simon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message