From owner-freebsd-hackers Thu Jun 28 11:49:41 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id AC95637B40C for ; Thu, 28 Jun 2001 11:49:38 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 15FgrB-0001WN-0K; Thu, 28 Jun 2001 18:49:37 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f5SImL700989; Thu, 28 Jun 2001 19:48:21 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 28 Jun 2001 19:48:21 +0100 (BST) From: Doug Rabson To: Nicolas Souchu Cc: Subject: Re: processes private data In-Reply-To: <20010628182533.B17804@avon.alcove-fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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