Tom Tromey wrote:
>>>>>> "Casey" == Casey Marshall <[EMAIL PROTECTED]> writes:
> 
> Casey> There are apparently a bunch of ways to get this data. This version is
> Casey> based on the 'sysctl' one described in W. Richard Stevens' book, UNIX
> Casey> Network Programming. This seems to work fine on Darwin; I'll try it on
> Casey> Linux when I get a chance.
> 
> The sysctl man page on linux says:
> 
>     The object names vary between kernel versions.  THIS MAKES THIS
>     SYSTEM CALL WORTHLESS FOR APPLICATIONS.
> 
> ... not exactly confidence inspiring, but perhaps the man page is not
> really correct.
> 
> FWIW in libgcj we use getifaddrs if it is available (this is a nice,
> easy-to-use API) or some horrible ioctls (SIOCGIFCONF and SIOCGIFADDR)
> otherwise.  We've also got a Windows port you could lift... if you had
> a way to build it I suppose.
> 

Sigh. You're right. The "sane" sysctl looks like a BSD thing.

> If Darwin has getifaddrs, I'd prefer we use it.  The ioctl stuff could
> probably just be ignored, I'd imagine it is more of a legacy system
> thing.
> 

getifaddrs is supported on Darwin, too. I'll use that.

> Casey> I've also changed some of the "RawData" functions in jcl.c.
> 
> A separate patch here would be good...
> 

OK.

> Casey> JCL_GetRawData depends on the static variable `rawData_fid' being
> Casey> initialized, which only gets set in `JCL_NewRawDataObject.'
> 
> The library should either initialize itself or we should require VMs
> using it to initialize it.
> 

We should initialize this properly ourselves, and not make the VM do it.
 JCL is Classpath-internal, so it should work and be portable.

> Casey>        * java/net/NetworkInterface.java (name, inetAddresses): removed.
> Casey>        (netif): new field.
> 
> This change is a bit of a pain since it means existing users all have
> to be updated.  If you think it is really important, we should still
> do it, of course ... but I'd prefer not to if possible.
> 

The point of this was to try and encapsulate data read/modified by
native code in it's own class. If we don't want to do this, that's fine.
I'll come up with an alternative.

> If we do change it, this has to be documented in NEWS, as it is a VM
> interface change.
> 

Yup.

Thanks.

Reply via email to