-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified 1995-07-22 by Michael Chastain <mec@duracef.shout.net>:
.\" 'gethostname' is real system call on Linux/Alpha.
.\" Modified 2004-06-17 by mtk
.\" Modified 2008-11-27 by mtk
.\"
-.TH GETHOSTNAME 2 2010-09-26 "Linux" "Linux Programmer's Manual"
+.TH GETHOSTNAME 2 2014-08-19 "Linux" "Linux Programmer's Manual"
.SH NAME
gethostname, sethostname \- get/set hostname
.SH SYNOPSIS
POSIX.1-2001 says that if such truncation occurs,
then it is unspecified whether the returned buffer
includes a terminating null byte.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success, zero is returned.
On error, \-1 is returned, and
.I errno
the caller did not have the
.B CAP_SYS_ADMIN
capability.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD).
POSIX.1-2001 specifies
.BR gethostname ()
.B HOST_NAME_MAX
is defined with the value 64, which has been the limit since Linux 1.0
(earlier kernels imposed a limit of 8 bytes).
-.SS Glibc Notes
+.SS C library/kernel ABI differences
The GNU C library does not employ the
.BR gethostname ()
system call; instead, it implements
.I errno
set to
.BR ENAMETOOLONG .
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR getdomainname (2),
.BR setdomainname (2),
.BR uname (2)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.