GETHOSTNAME(2) — HP-UX
NAME
gethostname − get name of current host
SYNOPSIS
int gethostname(hostname, size)
char *hostname;
unsigned int size;
DESCRIPTION
Gethostname returns in the array to which hostname points, the standard host name for the current processor as set by sethostname(2). Size specifies the length of the hostname array. Hostname is null-terminated unless insufficient space is provided.
RETURN VALUE
Gethostname returns a non-negative integer if successful. Otherwise, −1 is returned and errno is set to indicate the error.
ERRORS
Gethostname can fail if the following is true:
[EFAULT] Hostname points to an illegal address. The reliable detection of this error is implementation dependent.
AUTHOR
Gethostname was developed by the University of California, Berkeley.
SEE ALSO
hostname(1), uname(1), sethostname(2), uname(2).
Hewlett-Packard Company — May 11, 2021