Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2001 20:09:53 +0100
From:      mouss <usebsd@free.fr>
To:        Garance A Drosihn <drosih@rpi.edu>, hackers@FreeBSD.ORG
Cc:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Subject:   Re: [kernel patch] fcntl(...) to close many descriptors
Message-ID:  <01012820234100.00214@dades.chilali.net>
In-Reply-To: <p05010400b6981565909b@[128.113.24.47]>
References:  <4.3.0.20010126193228.06e2a200@bluesun> <p05010400b6981565909b@[128.113.24.47]>

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:)

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01012820234100.00214>