OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / gethostname.2
index b7f013b..e85bcc4 100644 (file)
@@ -1,7 +1,6 @@
-.\" 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.
@@ -21,6 +20,7 @@
 .\"
 .\" 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.
@@ -29,7 +29,7 @@
 .\" 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
@@ -86,7 +86,7 @@ then the name is truncated, and no error is returned (but see NOTES below).
 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
@@ -121,7 +121,7 @@ For
 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 ()
@@ -137,7 +137,7 @@ On Linux,
 .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
@@ -173,7 +173,16 @@ and the function returns \-1 with
 .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/.