Re: add closefrom() call
Ed Schouten wrote:
> * LI Xin <delphij@delphij.net> wrote:
>> Here is my implementation for FreeBSD. Some difference between my and
>> DragonFly's implementation:
>>
>> - closefrom(-1) would be no-op on DragonFly, my version would close all
>> open files (From my understanding of OpenSolaris's userland
>> implementation, this is Solaris's behavior).
>> - my version closefrom(very_big_fd) would result in EBADF. I am not
>> very sure whether this is correct, but it does not hurt for applications
>> that thinks closefrom() would return void.
>
> 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.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 10 之 26 篇):