This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Integrating Win32 changes


Per Bothner wrote:
> The specific issue about Win32 FileDescriptor are not specified using
> an int.  I would do:

Oh, it's an `int' all right:

CommonFunctions.h: HFILE STDCALL OpenFile(...)
Base.h: typedef int HFILE;

That might change with Win64, I don't know... we don't have to worry
about that for quite a while yet ;)

> -  // System's notion of file descriptor.
> +  // System's notion of file descriptor (use one or both):
>    private int fd;
> +  private gnu.gcj.RawData handle;
> 
> and you can hang your windows-specific data structures off `handle'.

Yuck.  Then we need extra code to allocate unique fd's, make it
thread-safe, etc.  I'd prefer to just cast HFILE to/from int, which is a
safe thing to do on any Win32 platform currently in use.

> To initialize in, out and err, we should perhaps do:
> 
>   public static final FileDescriptor in;
>   public static final FileDescriptor out;
>   public static final FileDescriptor err;
> 
>   private static native init();
>   static { init(); }
> 
> and have java::io::FileDescriptor::init() actually
> allocate in, out, and err.

Yes, I like that.

-- 
Jeff Sturm
jsturm@sigma6.com

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