/
gethostname TCP UDP

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.

Related content

sethostname TCP UDP
sethostname TCP UDP
More like this
getsockname TCP UDP
getsockname TCP UDP
More like this
getnameinfo TCP UDP
getnameinfo TCP UDP
More like this
getaddrinfo TCP UDP
getaddrinfo TCP UDP
More like this
getpeername TCP UDP
getpeername TCP UDP
More like this
bind TCP UDP
More like this