From owner-freebsd-hackers Mon Sep 6 1:28:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from asteroid.svib.ru (asteroid.svib.ru [195.151.166.145]) by hub.freebsd.org (Postfix) with ESMTP id 9269815DBD for ; Mon, 6 Sep 1999 01:28:00 -0700 (PDT) (envelope-from tarkhil@asteroid.svib.ru) Received: from shuttle.svib.ru (shuttle.svib.ru [195.151.166.144]) by asteroid.svib.ru (8.9.3/8.9.3) with ESMTP id MAA00999; Mon, 6 Sep 1999 12:27:55 +0400 (MSD) (envelope-from tarkhil@asteroid.svib.ru) Received: (from tarkhil@localhost) by shuttle.svib.ru (8.9.3/8.8.8) id MAA33988; Mon, 6 Sep 1999 12:27:56 +0400 (MSD) (envelope-from tarkhil) From: Alex Povolotsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14291.31498.931690.690026@shuttle.svib.ru> Date: Mon, 6 Sep 1999 12:27:54 +0400 (MSD) To: Bruce Evans Cc: hackers@freebsd.org Subject: Re: kern/13593: Problems with FIFO and select In-Reply-To: <199909060746.RAA29518@godzilla.zeta.org.au> References: <199909060746.RAA29518@godzilla.zeta.org.au> X-Mailer: VM 6.71 under 21.1 "20 Minutes to Nikko" XEmacs Lucid (patch 2) X-URL: http://freebsd.svib.ru Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> "Bruce" == Bruce Evans writes: >>> Description: >> Attempt to open FIFO file with O_WRONLY|O_NONBLOCK results in >> Device not configured error. Bruce> This is because there is no reader when the FIFO is opened for Bruce> writing (O_WRONLY opens of FIFOs normally block waiting for a Bruce> reader, but O_NONBLOCK gives an error instead). Well, but how do I multiplex on FIFO opening? >> However, when FIFO is opened with O_RDWR and O_NONBLOCK, every >> attempt to select(2) its handler for writing doesn't wait until >> someone opens FIFO for reading, but instead FIFO is ready to write >> at every select. Bruce> This is because O_RDWR gives both a reader and a writer. Well again, both things are reasonable, but I wanted to do the following: (1) open a control FIFO, for external commands (2) open a status FIFO, for status reporting (3) open several sockets for internal usage and than select() on all of them, waiting for either command to arrive, request for status, or (some internal event, select()-multiplexable). I can implement this using UNIX sockets and external programs, but can I make status reporting without external program? -- Alexander B. Povolotsky [ICQ 18277558] [2:5020/145] [http://freebsd.svib.ru] [tarkhil@asteroid.svib.ru] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message