Add a note that HOST_NAME_MAX does not include a terminating \0, unlike
authornicm <nicm@openbsd.org>
Mon, 12 Jan 2015 10:11:07 +0000 (10:11 +0000)
committernicm <nicm@openbsd.org>
Mon, 12 Jan 2015 10:11:07 +0000 (10:11 +0000)
MAXHOSTNAMELEN.

ok deraadt guenther

lib/libc/gen/gethostname.3

index 4ecf226..f4ae65c 100644 (file)
@@ -1,4 +1,4 @@
-.\"    $OpenBSD: gethostname.3,v 1.25 2014/01/21 03:15:45 schwarze Exp $
+.\"    $OpenBSD: gethostname.3,v 1.26 2015/01/12 10:11:07 nicm Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -27,7 +27,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: January 21 2014 $
+.Dd $Mdocdate: January 12 2015 $
 .Dt GETHOSTNAME 3
 .Os
 .Sh NAME
@@ -105,6 +105,13 @@ Host names are limited to
 .In sys/param.h )
 characters, currently 256.
 This includes the terminating NUL character.
+Note that the corresponding POSIX definition
+.Dv HOST_NAME_MAX
+in
+.In limits.h
+does
+.Em not
+include the terminating NUL character.
 .Pp
 If the buffer passed to
 .Fn gethostname