Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2007 16:51:38 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Ed Schouten <ed@fxq.nl>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: add closefrom() call
Message-ID:  <469AB30A.5000001@elischer.org>
In-Reply-To: <20070715211549.GB39075@hoeg.nl>
References:  <de5dfb5a0707041727j3e3518f9l5a019717a9f90aa@mail.gmail.com>	<20070705122650.GE1302@britannica.bec.de>	<468E16E6.6030608@delphij.net> <20070706112453.GA3217@hoeg.nl>	<468E7007.5050607@elischer.org> <20070715211549.GB39075@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Ed Schouten wrote:
> * Julian Elischer <julian@elischer.org> 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).
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?469AB30A.5000001>