Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jun 2001 19:48:21 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Nicolas Souchu <nsouch@fr.alcove.com>
Cc:        <freebsd-hackers@freebsd.org>
Subject:   Re: processes private data
Message-ID:  <Pine.BSF.4.33.0106281944210.866-100000@herring.nlsystems.com>
In-Reply-To: <20010628182533.B17804@avon.alcove-fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Jun 2001, Nicolas Souchu wrote:

> Hi folks,
>
> I have a char driver that must be opened by more than one process. The minor
> index is not sufficient for this. Is there any process private data (void *)
> in the devfs structure (or the opposite) I could point to with the minor index
> of my device?

The only way I know of to do this is to get a new struct file with
falloc() and install your own fileops. You can then set p->p_dupfd to the
new file descriptor and return ENXIO. The caller will magically use the
new struct file. For an example, see streamsopen() in
sys/dev/streams/streams.c.

-- 
Doug Rabson				Mail:  dfr@nlsystems.com
					Phone: +44 20 8348 6160



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?Pine.BSF.4.33.0106281944210.866-100000>