Re: add closefrom() call

看板FB_hackers作者時間18年前 (2007/07/24 11:05), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串26/26 (看更多)
On Monday 16 July 2007 02:25:37 pm Julian Elischer wrote: > Peter Jeremy wrote: > > On 2007-Jul-15 16:51:38 -0700, Julian Elischer <julian@elischer.org> wrote: > >>> void > >>> closefrom(int lowfd) > >>> { > >>> fcntl(lowfd, F_CLOSEM, NULL); > >>> } > >> what on earth would that achieve? > >> (as opposed to just a simple syscall) > > > > The only benefit I can think of is minimising the number of syscalls. > > Is there any other benefit? > > > > I don't think so.. it's less efficient, and harder to do.. > syscalls are not in short supply. Actually, adding a new fcntl is about the same as adding a new system call except that you don't have to generate tables, etc. (so it might actually be simpler). I'm not sure it's such a bad idea to just have a fcntl to get the max open fd and do the loop in userland so you get better auditing of the individual close() operations. -- John Baldwin _______________________________________________ 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"
文章代碼(AID): #16fMo600 (FB_hackers)
討論串 (同標題文章)
文章代碼(AID): #16fMo600 (FB_hackers)