VMS Help  —  TCPIP Services, Programming Interfaces, Socket API Functions, gethostname()
    Returns the fully-qualified name of the local host.
    Format
      #include  <types.h>
      #include  <socket.h>
      int gethostname  ( char *name, int namelen) ; (_DECC_V4_SOURCE)
      int gethostname  ( char *name, size_t namelen) ;
                       (not_DECC_V4_SOURCE)

1  –  Arguments

 name
    The address of a buffer where the name should be returned. The
    returned name is null terminated unless sufficient space is not
    provided.
 namelen
    The size of the buffer pointed to by name.

2  –  Description

    This function returns the translation of the logical names
    TCPIP$INET_HOST and TCPIP$INET_DOMAIN when used with the TCP/IP
    Services software.

3  –  Return Values

    0                  Indicates successful completion.
    -1                 Indicates an error occurred. The value of
                       errno indicates the error.

4  –  Errors

    EFAULT             The buffer described by name and namelen is
                       not a valid, writable part of the user address
                       space.
Close Help