Re: add closefrom() call
--GID0FwUMdk1T2AWN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
* 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=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 <ed@fxq.nl>
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--
討論串 (同標題文章)
完整討論串 (本文為第 21 之 26 篇):