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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to