VMS Help
TCPIP Services, Programming Interfaces, Sockets API, gethostbyname()

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

    Searches the hosts database sequentially from the beginning for a
    host record with a given name or alias.
    This function also invokes the BIND resolver to query the
    appropriate name server if the information requested is not in
    the hosts database.
    The $QIO equivalent is the IO$_ACPCONTROL function with the
    INETACP_FUNC$C_GETHOSTBYNAME subfunction code.
    Format
      #include  <netdb.h>
      struct hostent *gethostbyname  ( char *name );

  1 - Argument

 name
    A pointer to a null-terminated character string containing the
    name or an alias of the host being sought.

  2 - Description

    This function finds the first host in the hosts database with the
    given name or alias.
    The gethostbyname() function uses a common static area for its
    return values. This means that subsequent calls to this function
    overwrite previously returned host entries. You must make a copy
    of the host entry if you want to save it.

  3 - Return Values

    NULL               Indicates an error.
    x                  A pointer to an object having the hostent
                       structure.

  4 - Errors

    ENETDOWN           TCP/IP Services was not started.
    HOST_NOT_FOUND     Host is unknown.
    NO_DATA            The server recognized the request and the
                       name, but no address is available for the
                       name. Another type of name server request may
                       be successful.
    NO_RECOVERY        An unexpected server failure occurred. This is
                       a nonrecoverable error.
    TRY_AGAIN          A transient error occurred, for example,
                       the server did not respond. A retry may be
                       successful.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.