 address the specified service.

          (let* ((ai (car (getaddrinfo "www.gnu.org" "http")))
                 (s  (socket (addrinfo:fam ai) (addrinfo:socktype ai)
                             (addrinfo:protocol ai))))
            (connect s (addrinfo:addr ai))
            s)

     When SERVICE is omitted or is `#f', return network-level addresses
     for NAME.  When NAME is `#f' SERVICE must be provided and service
     locations local to the caller are returned.

     Additional hints can be provided.  When specified, HINT_FLAGS
     should be a bitwise-or of zero or more constants among the
     following:

     AI_PASSIVE
          Socket address is intended for `bind'.

     AI_CANONNAME
          Request for canonical host name, available via
          `addrinfo:canonname'.  This makes sense mainly when DNS
          lookups are involved.

     AI_NUMERICHOST
          Specifies that NAME is a numeric host address string (e.g.,
          `"127.0.0.1"'), meaning that name resolution will not be used.

     AI_NUMERICSERV
          Likewise, specifies that SERVICE is a numeric port string
          (e.g., `"80"').

     AI_ADDRCONFIG
          Return only addresses configured on the local system.  It is
          highly recommended to provide this flag when the returned
          socket addresses are to be used to make connections;
          otherwise, some of the returned addresses could be unreachable
          or use a protocol that is not supported.

     AI_V4MAPPED
          When looking up IPv6 addresses, return mapped IPv4 addresses
          if there is no IPv6 address available at all.

     AI_ALL
          If this flag is set along with `AI_V4MAPPED' when looking up
          IPv6 addresses, return all IPv6 addresses as well as all IPv4
          addresses, the latter mapped to IPv6 format.

     When given, HINT_FAMILY should specify the requested address
     family, e.g., `AF_INET6'.  Similarly, HINT_SOCKTYPE should specify
     the requested socket type (e.g., `SOCK_DGRAM'), and HINT_PROTOCOL
     should specify the requested protocol (its value is interpretered
     as in calls to `socket').

     On error, an exception with key `getaddrinfo-error' is thrown, with
     an error code (an integer) as its argument:

          (catch 'getaddrinfo-error
            (lambda ()
              (getaddrinfo "www.gnu.org" "gopher"))
            (lambda (key errcode)
              (cond ((= errcode EAI_SERVICE)
                     (display "doesn't know about Gopher!\n"))
                    ((= errcode EAI_NONAME)
                     (display "www.gnu.org not found\n"))
                    (else
                     (format #t "something wrong: ~a\n"
                             (gai-strerror errcode))))))

     Error codes are:

     EAI_AGAIN
          The name or service could not be resolved at this time.  Future
          attempts may succeed.

     EAI_BADFLAGS
          HINT_FLAGS contains an invalid value.

     EAI_FAIL
          A non-recoverable error occurred when attempting to resolve
          the name.

     EAI_FAMILY
          HINT_FAMILY was not recognized.

     EAI_NONAME
          Either NAME does not resolve for the supplied parameters, or
          neither NAME nor SERVICE were supplied.

     EAI_NODATA
          This non-POSIX error code can be returned on some systems (GNU
          and Darwin, at least), for example when NAME is known but
          requests that were made turned out no data.  Error handling
          code should be prepared to handle it when it is defined.

     EAI_SERVICE
          SERVICE was not recognized for the specified socket type.

     EAI_SOCKTYPE
          HINT_SOCKTYPE was not recognized.

     EAI_SYSTEM
          A system error occurred.  In C, the error code can be found in
          `errno'; this value is not accessible from Scheme, but in
          practice it provides little information about the actual error
          cause.

     Users are encouraged to read the POSIX specification
     (http://www.opengroup.org/onlinepubs/9699919799/functions/getaddrin
     fo.html) for more details.

