From owner-freebsd-current@FreeBSD.ORG Fri May 29 12:48:08 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEB029AA for ; Fri, 29 May 2015 12:48:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC4613C1 for ; Fri, 29 May 2015 12:48:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id ECAE81FE023; Fri, 29 May 2015 14:48:05 +0200 (CEST) Message-ID: <55686037.3080502@selasky.org> Date: Fri, 29 May 2015 14:48:55 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Luigi Rizzo , FreeBSD Current CC: Giuseppe Lettieri Subject: Re: per file descriptor device driver data ? References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2015 12:48:08 -0000 On 05/29/15 14:24, Luigi Rizzo wrote: > Our current design uses devfs_set_cdevpriv() during the open() > handler, but for some reason a subsequent devfs_get_cdevpriv(p) > returns *p = NULL in additional threads created by the process > that did the open(). Hi, Are you sure it is the same file handle passed around, that the FD's were not cloned? The devfs_set_cdevpriv() is per "struct file" in the kernel from my knowledge. --HPS