Returns the official hostname for the current machine.
#include <netdb.h> int gethostname ( char *name, int namelen);
(OUT) Points to a null-terminated string containing the official name of the host.
(IN) Specifies the size of the array pointed to by name.
If successful, returns 0. Otherwise, returns -1.
The gethostname function returns the standard hostname for the current host machine. The namelen parameter specifies the size of the array pointed to by name. The returned name is null terminated, unless insufficient space is provided.