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: java.io.FileDescriptor enhancement


>>>>> "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


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