Subject: Re: Time to fix a 25 year old misdesign
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Lennart Augustsson <>
List: tech-kern
Date: 10/17/2000 05:35:57
"Greg A. Woods" wrote:

> Do you think my idea of separating init()/uninit() from open()/close()
> would be the better way to provide such symmetry?

Yes, init()/uninit() for first open, last close.  And then incref()/decref()
for duplication and closing of file descriptors.

> If so do you think
> it's really worthwhile to go to the lengths that would be necessary to
> re-design the driver API in this way though?

No, I don't propose redesigning it.  I propose augmenting it with some
optional methods.

> The fact that the driver open() routine is called for every open(2) is
> more of where the hack is -- it's really just a way to enforce rare
> features like exclusive access (when it's required by the hardware), and
> other low-level restrictions (eg. requiring superuser access, etc.).

Indeed. :)


        -- Lennart