Date: Sun, 28 Jan 2001 10:37:16 -0800 (PST) From: Luigi Rizzo <rizzo@aciri.org> To: usebsd@free.fr (mouss) Cc: drosih@rpi.edu, hackers@FreeBSD.ORG, wollman@khavrinen.lcs.mit.edu Subject: Re: [kernel patch] fcntl(...) to close many descriptors Message-ID: <200101281837.f0SIbGI24332@iguana.aciri.org> In-Reply-To: <01012820234100.00214@dades.chilali.net> from mouss at "Jan 28, 2001 8: 9:53 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> I agree that breaking coherence is bad, though I find fcntl is the kind of > functions to use when you don't have a more specific one:) do we have (or could we design) a generic mechanism for machine-specific syscalls which are not available on all OS ? basically i am thinking of something like generic_syscall("fdcloseall", ....); In this way it would be clear what the non-portable pieces of code are, and the mechanism would be extensible with no changes to libraries and syscalls. You could even have dynamically-loaded modules implementing new "syscalls". cheers luigi > then I'd propose > int fdcloseall(int start); > > (I remember having seen some closeall() function in M$ windows > I think there is such function in M$ windows, so while I didn't sell my soul to > Bill, I don't see enough reason to choose a new one (that said, I'm not sure of > the syntax and use there...). > > Note that unlike fcntl() change, this requires adding a syscall, and remaking > libc. > > I'm gonna work on this (and put in the optimization idea suggested by Matt). > > regards, > mouss > > > On Sat, 27 Jan 2001, Garance A Drosihn wrote: > > > > [snip] > > void closeallfds(int start); > > > > While I understand that defining a new routine is more work > > than just adding a parameter to an existing routine, I do > > think it is more appropriate to have that new routine than > > to use fcntl for this. The description for fcntl says the > > first parameter is: > > a descriptor to be operated on by 'cmd' as > > described below. > > For the proposed F_CLOSEM command, it does not operate on the > > GIVEN fd, it operates on a whole bunch of OTHER fd's. This > > means that a program which calls fcntl with a cmd-argument > > which is different than the programmer thinks is being passed > > could cause some pretty painful-to-debug errors in sections of > > the program which have nothing to do with the section that has > > the bug. > > [snip] > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101281837.f0SIbGI24332>