int gethostname(name, namelen) char *name; int namelen;
int sethostname(name, namelen) char *name; int namelen;
gethostname() returns the standard host name for the current processor, as previously set by sethostname(). The parameter namelen specifies the size of the array pointed to by name. The returned name is null-terminated unless insufficient space is provided.
sethostname() sets the name of the host machine to be name, which has length namelen. This call is restricted to the super-user and is normally used only when the system is bootstrapped.
gethostname() and sethostname() return:
In addition to the above, sethostname() may set errno to:
Host names are limited to MAXHOSTNAMELEN (from <sys/param.h>) characters, currently 64.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97