gethostname(2)
_________________________________________________________________
gethostname System Call
Get name of current host.
_________________________________________________________________
SYNTAX
int gethostname (name, namelen)
char * name;
int namelen;
PARAMETERS
name Buffer to receive hostname.
namelen Buffer length in bytes.
DESCRIPTION
Gethostname returns the standard hostname for the host system, as
previously set by sethostname. The parameter <namelen> specifies
the size of the <name> string. The returned name is null-
terminated unless insufficient space is provided. Insufficient
space will truncate the name.
Hostnames are limited to MAXHOSTNAMELEN characters, which is
defined in <user/param.h>.
Calling gethostname before calling sethostname returns a zero
length hostname.
ACCESS CONTROL
None.
RETURN VALUE
0 Completed successfully.
-1 An error occurred. Errno is set to indicate the
error.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
gethostname(2)
EXCEPTIONS
Errno may be set to the following error code:
EFAULT The <name> parameter gave an invalid address, or
the <namelen> parameter specified a length less
than zero.
SEE ALSO
The related manual sections: gethostid(2), getdomainname(2),
sethostname(2).
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)