gethostname

gethostname returns an ASCII string that can be used with gethostbyname(use 0 to determine the IP address of the local host). Because the RT-TCP/IP stack has no concept of a host name internally, this function simply returns the IP address (in ASCII) of the first network interface.

Syntax

int gethostname(
    __out char *name,
    __in int namelen
);

Parameters

name

Pointer to a buffer to store the name.

namelen

The length, in bytes, of the buffer pointed by the name parameter.

Return Values

0 (zero) if the function succeeds, SOCKET_ERROR if the function succeeds

IntervalZero.com | Support | Give Feedback