localhost not recognised in getaddrinfo(3) in FreeBSD 9.0-STABLE

Unga unga888 at yahoo.com
Tue May 1 10:08:41 UTC 2012


Hi all

Following code fragment works in FreeBSD 8.1-RELEASE, but not in FreeBSD 9.0-STABLE:

error = getaddrinfo("localhost", port, &hints, &res0);
 if (error)
    {
     fprintf(stderr,"getaddrinfo failed - %s\n", gai_strerror(error));
     exit(1);
    }

It complains: getaddrinfo failed - hostname nor servname provided, or not known

Any idea why?

Best regards
Unga



More information about the freebsd-questions mailing list