From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 3 04:32:18 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97BAD16A46D for ; Sun, 3 Jun 2007 04:32:17 +0000 (UTC) (envelope-from craig@tobuj.gank.org) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.freebsd.org (Postfix) with ESMTP id 83E4E13C457 for ; Sun, 3 Jun 2007 04:32:15 +0000 (UTC) (envelope-from craig@tobuj.gank.org) Received: by ion.gank.org (Postfix, from userid 1001) id 23B09110F2; Sat, 2 Jun 2007 23:32:15 -0500 (CDT) Date: Sat, 2 Jun 2007 23:32:13 -0500 From: Craig Boston To: mal content Message-ID: <20070603043203.GA1341@nowhere> Mail-Followup-To: Craig Boston , mal content , freebsd-hackers@freebsd.org References: <8e96a0b90706021557h2168337emb9b7b59a2084530e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e96a0b90706021557h2168337emb9b7b59a2084530e@mail.gmail.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-hackers@freebsd.org Subject: Re: Open FIFO non-blocking but have write() block(?) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2007 04:32:18 -0000 On Sat, Jun 02, 2007 at 11:57:19PM +0100, mal content wrote: > Logging date appears on one, to be read by any external program and > commands are read by the program from the other. I can't speak to the blocking semantics, but if you plan to have more than one process reading at once, FIFOs won't do what you want. I suspect unix sockets are closer to the behavior you're after. IIRC using them in datagram mode may give you the ability to write whether or not anyone is listening. Otherwise you'll have to do the normal listen, accept, select/poll loop. Craig