gethostname(3N-xs) (X/OPEN SOCKETS) gethostname(3N-xs)
NAME
gethostname - get name of current host
SYNOPSIS
cc [flag ...] file ... -lxnet [library ...]
#include <unistd.h>
int gethostname(char *name, sizet namelen);
DESCRIPTION
The gethostname function returns the standard host name for the
current machine. The namelen argument specifies the size of the array
pointed to by the name argument. The returned name is null-terminated,
except when namelen is not long enough to contain the host name, in
which case the returned name is truncated and it is unspecified
whether the returned name is null-terminated.
Host names are limited to 255 bytes.
RETURN VALUE
On successful completion, 0 is returned. Otherwise, -1 is returned.
ERRORS
No errors are defined.
FILES
/usr/lib/libxnet.so.1
SEE ALSO
uname(2), gethostid(3N), unistd(4).
Page 1 Reliant UNIX 5.44 Printed 11/98