GETHOSTNAME(2) GENIX Programmer's Manual GETHOSTNAME(2)
NAME
gethostname, sethostname - get/set name of current host
SYNOPSIS
gethostname (name, namelenp)
char *name;
int *namelenp;
sethostname (name, namelen)
char *name;
int *namelen;
DESCRIPTION
Gethostname returns the standard host name for the current proces-
sor, as previously set by sethostname. The parameter namelenp
specifies the size of the name array, and is modified on return to
indicate the actual size of the host name returned. The name is
null-terminated.
Sethostname sets the name of the host machine to be name, which has
length namelen. This system call is normally executed when the sys-
tem is bootstrapped.
RETURN VALUE
If the call succeeds a value of 0 is returned. If the call fails,
then a value of -1 is returned and an error code is placed in the
global location errno.
ERRORS
The following errors may be returned by these calls:
[EFAULT] The name or namelenp parameter gave an invalid address.
BUGS
Host names are limited to 255 characters.
Printed 7/16/83 1