From owner-cvs-src@FreeBSD.ORG Sat Aug 9 00:16:13 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27168106566B; Sat, 9 Aug 2008 00:16:13 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 0A9578FC1B; Sat, 9 Aug 2008 00:16:12 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id AD7C51A4D83; Fri, 8 Aug 2008 17:16:12 -0700 (PDT) Date: Fri, 8 Aug 2008 17:16:12 -0700 From: Alfred Perlstein To: Peter Jeremy Message-ID: <20080809001612.GN16977@elvis.mu.org> References: <200808081343.m78DhwYE068477@repoman.freebsd.org> <200808081226.32089.jhb@freebsd.org> <20080809001256.GL64458@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080809001256.GL64458@server.vk2pj.dyndns.org> User-Agent: Mutt/1.4.2.3i Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Ed Schouten , cvs-all@freebsd.org, John Baldwin Subject: Re: cvs commit: src/sys/dev/io iodev.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2008 00:16:13 -0000 * Peter Jeremy [080808 17:13] wrote: > On 2008-Aug-08 12:26:31 -0400, John Baldwin wrote: > >It should be setting D_TRACKCLOSE though so that close() reliably clears the > >flag even in single-threaded processes. You can still get odd behavior if > >you explicitly open it twice in an app and then close one of the two fd's. > >You will no longer have IO permission even though you still have one fd open. > >However, if you do that I think you deserve what you asked for. :) > > That behaviour may be legitimate: Your code links with libraries foo and > bar that each independently open /dev/io so they can frob different things > in IO space. libfoo needs ongoing access to device foo and so keeps its > descriptor open. libbar only needs once-off access to device bar and so > closes /dev/io once it's finished its initialisation. Libraries foo and > bar are completely independent and shouldn't need to know anything about > each other and your app shouldn't need to know that libraries it's using > frob around in IO space. Sort of the same problem with sysv style fcntl locks. :( -- - Alfred Perlstein