This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: java.io.FileDescriptor enhancement
- From: Tom Tromey <tromey at redhat dot com>
- To: Michael Koch <konqueror at gmx dot de>
- Cc: java-patches at gcc dot gnu dot org
- Date: 31 Mar 2003 20:33:33 -0700
- Subject: Re: java.io.FileDescriptor enhancement
- References: <200303302015.38877.konqueror@gmx.de>
- Reply-to: tromey at redhat dot com
>>>>> "Michael" == Michael Koch <konqueror at gmx dot de> writes:
Michael> java.io.FileDescriptor in classpath has the package-private method
Michael> getNativeFd() which returns the file descriptor used by the native
Michael> implementation.
Michael> I would like to introduce such a method too for the libgcj version to
Michael> make it easier to use FileDescriptor objects (mainly for java.nio).
Michael> What do you think about this ?
First, I thought we hadn't finally decided on the representation of
the native fd. We've talked at times about making it a RawData.
`long' would probably work just as well, at least for the foreseeable
future.
Second, is there any way that java.nio can just use FileDescriptor? I
haven't read about java.nio, so I don't know the issues, but I'm
concerned about two things: first, that we'll be making the platform
layer more confusing and harder to maintain; second, that we'll end up
with problems where both some java.nio object and some FileDescriptor
object think they own some fd, and one closes it while the other
thinks it should be open. Sharing the FileDescriptor would prevent
this sort of thing.
Tom