[PATCH]: linux ioctls not implemented - advice?
Peter Kostouros
kpeter at melbpc.org.au
Fri Jul 27 23:45:54 UTC 2007
Hi
I applied the patch on a recent current (27JUL2007) but unfortunately I
still see the ioctl is not implemented message on the console.
A simple java application that identifies the problem is:
package hell.from.baron.test;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
public class TestUtil {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
String[] ips = TestUtil.getHostAddresses();
for (int i = 0; i < ips.length; i++)
System.out.println("IP[" + Integer.toString(i) + "]" + "
: " + ips[i]);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
public static String[] getHostAddresses() throws Exception {
List<String> hostIps = new ArrayList<String>();
Enumeration<NetworkInterface> nifs =
NetworkInterface.getNetworkInterfaces();
while (nifs.hasMoreElements()) {
NetworkInterface nif = (NetworkInterface)nifs.nextElement();
Enumeration<InetAddress> ips =
nif.getInetAddresses();
while (ips.hasMoreElements()) {
InetAddress ip = (InetAddress)ips.nextElement();
hostIps.add(ip.getHostAddress());
}
}
return (String[])hostIps.toArray(new String[0]);
}
}
Running this application under (Linux) Java SE Runtime Environment
(build 1.6.0_02-b05) I get the following output:
java.net.SocketException: Cannot assign requested address
at java.net.NetworkInterface.getAll(Native Method)
at
java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:281)
at hell.from.baron.test.TestUtil.getHostAddresses(TestUtil.java:29)
at hell.from.baron.test.TestUtil.main(TestUtil.java:17)
and on the console
linux: pid 1497 (java): ioctl fd=5, cmd=0x8933 ('\M^I',51) is not
implemented
whereas under Java 2 Runtime Environment (build
1.5.0_11-p5_15_jun_2007_15_10) I get:
IP[0] : 127.0.0.1
IP[1] : 192.168.0.2
I grep'ed through the JDK source code and found SIOCGIFINDEX referenced
in file jdk/j2se/src/solaris/native/java/net/NetworkInterface.c. I am
trying to locate where the error is raised to provide further
information, but thus far have been unsuccessful.
Note I am running with compat.linux.osrelease=2.4.2.
--
Regards
Peter
As always the organisation disavows knowledge of this email
More information about the freebsd-emulation
mailing list