Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2009 15:40:24 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: device driver: cdesw questions?
Message-ID:  <497725C8.4010101@icyb.net.ua>
In-Reply-To: <20090121133520.GK58517@deviant.kiev.zoral.com.ua>
References:  <49770513.8090203@icyb.net.ua> <20090121133520.GK58517@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
on 21/01/2009 15:35 Kostik Belousov said the following:
> On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon wrote:
>> Question 1:
>> I am writing a driver that would use per-open private data (among other
>> features).
>> Do I have to use D_TRACKCLOSE flag in this case?
> No, the dtr registered with devfs_set_cdevpriv(), is called exactly once
> when the last close is performed, or the device is destroyed.

Kostik,

thanks a lot for the explanation!
I am still a little bit confused about the term "last close" - what is
it? I.e. I'd like to get an answer to the below question.

>> In general I am a little bit confused about when d_close is invoked.
>> Supposing D_TRACKCLOSE is not set and multiple programs concurrently
>> open, use and close a device - when d_close is called - when one program
>> closes its last descriptor tied to the device or when the system-wide
>> last such descriptor is closed?



-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?497725C8.4010101>