Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2012 03:08:34 -0700 (PDT)
From:      Unga <unga888@yahoo.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   localhost not recognised in getaddrinfo(3) in FreeBSD 9.0-STABLE
Message-ID:  <1335866914.5649.YahooMailNeo@web160106.mail.bf1.yahoo.com>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1335866914.5649.YahooMailNeo>