gethostname TCP UDP

Returns the name of the host in a null-terminated c-string array.

Files

net_bsd.h/net_bsd.c

Prototype

int  gethostname (char    *host_name,
                  _size_t  name_len);

Arguments

host_name

Character array that will receive the returned host name.

name_len

This is the length of the host name array (in octets) including null-terminating char.

Returned Value

0, if no error.

-1, otherwise.