Pike fails to resolve hostnames in System.chroot'ed pike

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3471

Reported by Thomas Bopp, Uni-GH Paderborn astra@upb.de

After chroot gethostbyname does not work anymore.

void main()
{
   System.chroot("/root");
   write("Result="+sprintf("%O",System.gethostbyname("mail"))+"\n");
}

Removing the first line I get the normal array, with chroot it returns 0.