------- Comment #2 from greenrd at gcc dot gnu dot org 2005-10-30 12:00 ------- The real problem here was that I had a typo in my /etc/hosts, so the hostname could not be resolved. I've updated the bug summary.
GNU classpath 0.18 implements the correct behaviour: $ jamvm TestAddr java.net.UnknownHostException: lcoyle1 at java.net.VMInetAddress.getHostByName (Native Method) at java.net.InetAddress.getAllByName (InetAddress.java:667) at java.net.InetAddress.getByName (InetAddress.java:622) at java.net.InetAddress.getLocalHost (InetAddress.java:777) at TestAddr.main (TestAddr.java:7) -- greenrd at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|InetAddress.getLocalHost() |[4.0 only] |returns broken InetAddress |InetAddress.getLocalHost() |object when run in chroot |returns broken InetAddress | |object when local hostname | |cannot be resolved http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24583