From owner-freebsd-drivers@FreeBSD.ORG Mon Dec 19 15:58:08 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 361D216A41F for ; Mon, 19 Dec 2005 15:58:08 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5BD643D45 for ; Mon, 19 Dec 2005 15:58:07 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jBJFuaR4008202; Mon, 19 Dec 2005 08:56:37 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Dec 2005 08:57:07 -0700 (MST) Message-Id: <20051219.085707.00459236.imp@bsdimp.com> To: hide_yama@jcom.home.ne.jp From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 19 Dec 2005 08:56:37 -0700 (MST) Cc: freebsd-drivers@freebsd.org Subject: Re: Close never called. (Open same device file from 2 Apps.) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 15:58:08 -0000 In message: "hide_yama" writes: : Hi everybody : : Now, I'm writing device driver on 5.4R. But it doesn't act that I : unexpected. : So, if you know the reason and the avoidance, please tell to me. : Work is as follows. : : 1) Open device file "/dev/mypci" by App1. : This App1 just calls open routine and sleep for a while in it's program. : : 2) Open and close the same device file by App2 befor App1 is expired. : App2 calls just open and close routines in it's program. : : I expect that App2 calls open and close routines, however App2 just calls : open, doesn't call close. : : Why isn't the close routine called? Because close is only called on the last close. : And are there any avoidance for this problem? D_TRACKCLOSE in d_flags will change the behavior. Warner