This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: remove all traces of java.io.FileDescriptor from java.net


>>>>> "Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:

Bryce> I agree that it is incorrect. But how likely is this to occur?
Bryce> Does linux actually re-use closed file descriptor numbers like
Bryce> this? My recollection is that it doesn't (at least for a long
Bryce> time). But maybe I'm wrong.

Historically Unix always allocated the smallest available fd.
If you dig in some old sources you can find a replacement
implementation of dup2() that uses only close() and dup().
I wouldn't be surprised if Linux does this as well, for compatibility
if nothing else.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]