From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 10 14:27:33 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A59106566C for ; Mon, 10 Aug 2009 14:27:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 7C8068FC38 for ; Mon, 10 Aug 2009 14:27:32 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=hlIU1J3LQChSjWV/CGRL5g==:17 a=6I5d2MoRAAAA:8 a=vMRqgvaLNkSmAsaVmwIA:9 a=yfCDHKOdtT3hj6lYpNUrFTIvMBAA:4 Received: from [193.217.167.6] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1285097494; Mon, 10 Aug 2009 15:27:30 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Mon, 10 Aug 2009 15:27:31 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <4A8006F3.5020800@bulinfo.net> In-Reply-To: <4A8006F3.5020800@bulinfo.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908101527.32952.hselasky@c2i.net> Cc: Krassimir Slavchev Subject: Re: Help with device drivers 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: Mon, 10 Aug 2009 14:27:34 -0000 On Monday 10 August 2009 13:39:31 Krassimir Slavchev wrote: > If I try to open the device from userland with: > fd = open("/dev/xxx0", O_RDWR) it fails because open() tries to open the > device for reading first and then for writing. There is a bug in the code. If you open using read+write flags, then the FIFO open routine is called two times. The RD+WR check should be moved to the ioctl routine. http://perforce.freebsd.org/chv.cgi?CH=167171 --HPS