NAME

  tst_gai_strerror - Provides a descriptive text string corresponding to an EAI_xxx error value


PURPOSE

  To check that gai_strerror() can provides a descriptive text
  string corresponding to an EAI_xxx error value.


SYNOPSIS

  ./tst_gai_strerror [-tooloption ...]
    -tooloption : v6api tool option


TEST PROCEDURE

  1. Get descriptive text string of error EAI_AGAIN
  2. CHeck A: return descriptive text string is not NULL
  3. Get descriptive text string of error EAI_BADFLAGS
  4. CHeck B: return descriptive text string is not NULL
  5. Get descriptive text string of error EAI_FAIL
  6. CHeck C: return descriptive text string is not NULL
  7. Get descriptive text string of error EAI_FAMILY
  8. CHeck D: return descriptive text string is not NULL
  9. Get descriptive text string of error EAI_MEMORY
  10.CHeck E: return descriptive text string is not NULL
  11.Get descriptive text string of error EAI_NONAME
  12.CHeck F: return descriptive text string is not NULL
  13.Get descriptive text string of error EAI_SERVICE
  14.CHeck G: return descriptive text string is not NULL
  15.Get descriptive text string of error EAI_SOCKTYPE
  16.CHeck H: return descriptive text string is not NULL
  17.Get descriptive text string of error EAI_SYSTEM
  18.CHeck I: return descriptive text string is not NULL
  19.Get descriptive text string of error 0
  20.CHeck J: return descriptive text string is not NULL


NOTE

  None


REFERENCE

  RFC 3493
  6.1 Protocol-Independent Nodename and Service Name Translation
    Note: This makes it easier to compare socket address structures.
    Error Return Values:
    The getaddrinfo() function shall fail and return the corresponding
    value if:
    [EAI_AGAIN]     The name could not be resolved at this time.  Future
                    attempts may succeed.
    [EAI_BADFLAGS]  The flags parameter had an invalid value.
    [EAI_FAIL]      A non-recoverable error occurred when attempting to
                    resolve the name.
    [EAI_FAMILY]    The address family was not recognized.
    [EAI_MEMORY]    There was a memory allocation failure when trying to
                    allocate storage for the return value.
    [EAI_NONAME]    The name does not resolve for the supplied
                    parameters.  Neither nodename nor servname were
                    supplied.  At least one of these must be supplied.
    [EAI_SERVICE]   The service passed was not recognized for the
                    specified socket type.
    [EAI_SOCKTYPE]  The intended socket type was not recognized.
    [EAI_SYSTEM]    A system error occurred; the error code can be found
                    in errno.
    The gai_strerror() function provides a descriptive text string
    corresponding to an EAI_xxx error value.
      #include <netdb.h>
      const char *gai_strerror(int ecode);
    The argument is one of the EAI_xxx values defined for the
    getaddrinfo() and getnameinfo() functions.  The return value points
    to a string describing the error.  If the argument is not one of the
    EAI_xxx values, the function still returns a pointer to a string
    whose contents indicate an unknown error.