On Sat, Dec 11, 1999 at 07:14:37PM -0800, David Greenman wrote:
> >The question is very simple. Is it possible to open the same character
> >pseudo device, for example /dev/foo0, simultaneously from other programs,
> >and to work with this instances independently?
> >
> The simple answer is yes.
Ok. Where I could to store the pointer to instance of opened device?
The data passed to d_open, I mean dev_t, is a specific only to major/minor
device number. And how to have access to this context in other device methods?
> The only issue has to do with closing the device.
> If you don't care about the device driver close routine being called except
> on the last close, then everything should work just fine.
This is a unlikely future, to have only on last close, because close doing
release of system resources (per instance allocated).
> I assume this question is related to you work on VMware for FreeBSD?
Exactly, this guys to create new virtual machine opened /dev/vmmon device,
and stored private data in the special field of the 'struct file'. And the same,
with networking. Of course I mean Linux version of their drivers.
The FreeBSD version of these drivers store data in the dev_t structure,
and because of that it's working fine until you are don't tried to open a new
session.
--
Vladimir Silyaev
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message