gethostname

gethostname returns an ASCII string representation of the first IPv4 address configured on a system.

Syntax

Copy
int gethostname(
    char *name,
    int namelen
);

Parameters

name

A pointer to a buffer to store the name.

namelen

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

Return Value

If the function succeeds, it returns 0 (zero). If the function fails, it returns SOCKET_ERROR.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Winsock2.h RtTcpipApi.lib