Integrating Win32 changes

Jeff Sturm jsturm@sigma6.com
Sat Apr 1 00:00:00 GMT 2000


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


More information about the Java mailing list