This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: WIN-28: fix POSIX file descriptor numbering assumptions
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: Sat, 02 Mar 2002 16:38:02 +1300
- Subject: Re: WIN-28: fix POSIX file descriptor numbering assumptions
- References: <86d6yto40o.fsf@megacz.com>
Adam Megacz wrote:
>Sorry, sent this to java@ instead of java-patches@
>
>ok to commit?
>
> - a
>
>2002-02-25 Adam Megacz <adam@xwt.org>
>
> * java/io/FileDescriptor.java: We now use getFD**().
> * java/io/natFileDescriptorWin32.cc (getFDin, getFDout,
> getFDerr): Added these.
> * java/io/natFileDescriptorPosix.cc (getFDin, getFDout,
> getFDerr): Added these.
> * java/io/natFileDescriptorEcos.cc (getFDin, getFDout,
> getFDerr): Added these.
>
How about putting the initialization of in/out/err into a native method
and calling it from a static initializer, ie:
static
{
initNative();
}
This will be slightly cleaner and more efficient, and the initNative
might come in useful later.
Also, you should add a fixme in the win32 code about how wrong it is to
store the file handle as an int!
Bryce.