.TH gethostname() "" "" "Sockets Function (libsocket)"
.PC "Get the name of the local host"
.B "#include <sys/utsname.h>"
\fBint gethostname (\fIname\^\fB, \fIlength\^\fB)\fR
\fBchar *\fIname\^\fB;\fR
\fBint \fIlength\^\fB;\fR
.PP
Function
.B gethostname()
reads the name of your local host.
.PP
.I name
points to the chunk of memory into which
.B gethostname()
is to write the name of the local host.
.I length
gives the length of that chunk of memory.
.PP
.B gethostname()
returns \-1 if it could not read the name of the local host.
Otherwise, it returns zero.
.SH "See Also"
.Xr "libsocket" libsocket
.SH Notes
.I name
must point to enough memory to hold the name of your local host.
If it does not, the behavior of this function
is undefined (and probably unwelcome).
.I "Caveat utilitor."
