Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Dec 1999 23:24:07 -0500
From:      "Vladimir N. Silyaev" <vsilyaev@mindspring.com>
To:        David Greenman <dg@root.com>
Cc:        "Vladimir N. Silyaev" <vsilyaev@mindspring.com>, hackers@FreeBSD.ORG
Subject:   Re: Multiple instances of the same character device
Message-ID:  <19991211232407.A1699@jupiter.delta.ny.us>
In-Reply-To: <199912120314.TAA03134@implode.root.com>; from dg@root.com on Sat, Dec 11, 1999 at 07:14:37PM -0800
References:  <199912120314.TAA03134@implode.root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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