Re: add closefrom() call
On Fri, Jul 06, 2007 at 06:18:14PM +0800, LI Xin wrote:
> - 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).
I think this is a bad idea as -1 is generally an invalid file
descriptor.
> - 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.
I don't think this is a good idea either. One typical use is closefrom(3)
and returning an error because no such descriptors are open sounds very
wrong. It also just adds another special case as the loop handles this
already....
Joerg
_______________________________________________
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"
討論串 (同標題文章)
完整討論串 (本文為第 8 之 26 篇):