From owner-freebsd-hackers Sun Jan 28 10:24:36 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from postfix2-2.free.fr (postfix2-2.free.fr [213.228.0.140]) by hub.freebsd.org (Postfix) with ESMTP id 64EBC37B400 for ; Sun, 28 Jan 2001 10:24:17 -0800 (PST) Received: from dades.chilali.net (paris11-nas7-53-248.dial.proxad.net [212.27.53.248]) by postfix2-2.free.fr (Postfix) with SMTP id 238426B82A; Sun, 28 Jan 2001 19:24:14 +0100 (CET) From: mouss To: Garance A Drosihn , hackers@FreeBSD.ORG Subject: Re: [kernel patch] fcntl(...) to close many descriptors Date: Sun, 28 Jan 2001 20:09:53 +0100 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain Cc: Garrett Wollman References: <4.3.0.20010126193228.06e2a200@bluesun> In-Reply-To: MIME-Version: 1.0 Message-Id: <01012820234100.00214@dades.chilali.net> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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:) 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