From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 11 22:27:56 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2D4516A46C for ; Wed, 11 Jul 2007 22:27:56 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.pkgsrc-box.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4AA13C455 for ; Wed, 11 Jul 2007 22:27:56 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (www.pkgsrc-box.org [127.0.0.1]) by www.pkgsrc-box.org (Postfix) with ESMTP id 35576E7A3FA for ; Wed, 11 Jul 2007 22:27:54 +0000 (UTC) Received: by britannica.bec.de (Postfix, from userid 1000) id 818027D3B; Thu, 12 Jul 2007 00:27:02 +0200 (CEST) Date: Thu, 12 Jul 2007 00:27:01 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20070711222700.GB23838@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <46930106.3040503@gmail.com> <20070710123634.GD1194@britannica.bec.de> <4693C77E.7070806@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4693C77E.7070806@elischer.org> User-Agent: Mutt/1.5.13 (2006-08-11) Subject: Re: add closefrom() call X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2007 22:27:56 -0000 On Tue, Jul 10, 2007 at 10:53:02AM -0700, Julian Elischer wrote: > Joerg Sonnenberger wrote: > >On Mon, Jul 09, 2007 at 11:46:14PM -0400, Ighighi wrote: > >>Calling F_MAXFD everytime we close a file descriptor would be heavy > >>having too much fd's. > >>On the other hand, it wouldn't make much a difference to just start from > >>getdtablesize() - 1. > > > >I fully agree. That is the second version of closefrom in DragonFly -- > >for the purpose of libc_r BTW. > > This is silly.. > All the code needed to do this is already in the kernel. > It's needed at exit time. > Make a syscall as a front end to it and be done with it. As I said -- this was done only in libc_r because of the additional constraints of not closing the internal pipe. For any other use case, I full heartedly agree. Joerg