From owner-freebsd-hackers Mon Sep 6 0:37:20 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lungold.riddles.org.uk (lungold.riddles.org.uk [169.207.30.215]) by hub.freebsd.org (Postfix) with ESMTP id D729615166; Mon, 6 Sep 1999 00:37:17 -0700 (PDT) (envelope-from andrew@erlenstar.demon.co.uk) Received: from erlenstar.demon.co.uk (erlenstar.demon.co.uk [194.222.144.22]) by lungold.riddles.org.uk (8.9.3/8.9.2) with ESMTP id CAA07619; Mon, 6 Sep 1999 02:36:18 -0500 (CDT) (envelope-from andrew@erlenstar.demon.co.uk) Received: (from andrew@localhost) by erlenstar.demon.co.uk (8.8.8/8.8.8) id IAA01422; Mon, 6 Sep 1999 08:36:16 +0100 (BST) (envelope-from andrew) To: Alex Povolotsky Cc: stable@freebsd.org, hackers@freebsd.org Subject: Re: Problems with FIFO open in non-blocking mode? References: <199909060547.JAA29146@shuttle.svib.ru> From: Andrew Gierth In-Reply-To: Alex Povolotsky's message of "Mon, 6 Sep 1999 09:47:32 +0400 (MSD)" X-Mayan-Date: Long count = 12.19.6.9.3; tzolkin = 9 Akbal; haab = 11 Mol X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-Attribution: AG Date: 06 Sep 1999 08:36:16 +0100 Message-ID: <87k8q41ogf.fsf@erlenstar.demon.co.uk> Lines: 23 X-Mailer: Gnus v5.5/Emacs 20.2 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> "Alex" == Alex Povolotsky writes: Alex> if ((control = open("STATUS",O_WRONLY|O_NONBLOCK))<0) { Alex> fails to run (STATUS is pre-created FIFO file) with error Alex> "Device not configured", which seems kinda odd for me. Alex> However, when FIFO is opened with O_RDWR and O_NONBLOCK, every Alex> attempt to select(2) its handler for writing doesn't wait until Alex> someone opens FIFO for reading, but instead FIFO is ready to Alex> write at every select. Alex> Is it a bug or a feature? Both are features. The behaviour of open() in the first case is required by standards. In the second case, the fact that the FIFO has been opened O_RDWR means that it _is_ ready for writing, and select() is correctly returning the fact. -- Andrew. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message