From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 15 21:17:47 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 8019F16A402 for ; Sun, 15 Jul 2007 21:17:47 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [83.98.131.211]) by mx1.freebsd.org (Postfix) with ESMTP id 44D5C13C49D for ; Sun, 15 Jul 2007 21:17:47 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 901131CCE9; Sun, 15 Jul 2007 23:15:49 +0200 (CEST) Date: Sun, 15 Jul 2007 23:15:49 +0200 From: Ed Schouten To: Julian Elischer Message-ID: <20070715211549.GB39075@hoeg.nl> References: <20070705122650.GE1302@britannica.bec.de> <468E16E6.6030608@delphij.net> <20070706112453.GA3217@hoeg.nl> <468E7007.5050607@elischer.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline In-Reply-To: <468E7007.5050607@elischer.org> User-Agent: Mutt/1.5.16 (2007-06-09) 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 21:17:47 -0000 --GID0FwUMdk1T2AWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * 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=20 > efficiency > makes it worth putting it in the kernel. > Quite a few programs I know of could really help their startup time with= =20 > 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); } Similar to creat(2). --=20 Ed Schouten WWW: http://g-rave.nl/ --GID0FwUMdk1T2AWN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGmo6F52SDGA2eCwURAnI2AJ98yhDPAS1zfPnV2Q4oj9QBYQLT0QCfQYlS 8W47SRPeVhjywVixGGKPAFM= =PCd4 -----END PGP SIGNATURE----- --GID0FwUMdk1T2AWN--