[arch-general] getaddrinfo

clemens fischer ino-news at spotteswoode.dnsalias.org
Fri Dec 9 15:07:07 EST 2011


Myra Nelson wrote:

> After some more searching, work, and this email from the libc help
> list [ http://sourceware.org/ml/libc-help/2011-12/msg00000.html
> ] , I've attempted the code from Ulrich Dreppers page at
> http://www.akkadia.org/drepper/userapi-ipv6.html . The newer version
> of the code (on the right ) which is supposed to be protocol
> independent returns getaddrinfo: Servname not supported for
> ai_socktype, while the older version ( on the left ) seg faults.

Read the manual page getaddrinfo(3).  I presume the error in the newer
version is:

  EAI_SERVICE
    The requested service is not available for the requested socket
    type.  It may be available through another socket type.  For
    example, this error could occur if service was "shell" (a service
    only available on stream sockets), and either hints.ai_protocol was
    IPPROTO_UDP, or hints.ai_socktype was SOCK_DGRAM; or the error could
    occur if service was not NULL, and hints.ai_socktype was SOCK_RAW (a
    socket type that does not support the concept of services).

How did you run the program?  If you use "http" instead of "echo", does
it work with some www host?

With the older version, did you perhaps forget some vital "&" or "*"?


clemens



More information about the arch-general mailing list