From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 15 23:51:12 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 F049D16A402 for ; Sun, 15 Jul 2007 23:51:12 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outR.internet-mail-service.net (outR.internet-mail-service.net [216.240.47.241]) by mx1.freebsd.org (Postfix) with ESMTP id D982D13C478 for ; Sun, 15 Jul 2007 23:51:12 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Sun, 15 Jul 2007 16:51:12 -0700 Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 30811125ADC; Sun, 15 Jul 2007 16:51:11 -0700 (PDT) Message-ID: <469AB30A.5000001@elischer.org> Date: Sun, 15 Jul 2007 16:51:38 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Ed Schouten References: <20070705122650.GE1302@britannica.bec.de> <468E16E6.6030608@delphij.net> <20070706112453.GA3217@hoeg.nl> <468E7007.5050607@elischer.org> <20070715211549.GB39075@hoeg.nl> In-Reply-To: <20070715211549.GB39075@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers 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: Sun, 15 Jul 2007 23:51:13 -0000 Ed Schouten wrote: > * Julian Elischer wrote: >> Ed Schouten wrote: >>> Wouldn't it be better to just implement it through fcntl() and implement >>> closefrom() in libc? >> that's a possibility but I personally thing the huge difference in >> efficiency >> makes it worth putting it in the kernel. >> Quite a few programs I know of could really help their startup time with >> this as the first thing they do is "close the first 2000 file descriptors. > > Woops! Sorry for responding this late, but it looks like I didn't > explain myself good enough. Sorry. :) To rephrase myself: > > Wouldn't it be better to just implement fcntl(..., F_CLOSEM, ...) in the > kernel and make closefrom() a simple libc routine: > > void > closefrom(int lowfd) > { > fcntl(lowfd, F_CLOSEM, NULL); > } > what on earth would that achieve? (as opposed to just a simple syscall) > Similar to creat(2). >