summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getdomainname.312
-rw-r--r--lib/libc/gen/gethostname.319
2 files changed, 23 insertions, 8 deletions
diff --git a/lib/libc/gen/getdomainname.3 b/lib/libc/gen/getdomainname.3
index 42c620c1ed1..fe4d944c3a7 100644
--- a/lib/libc/gen/getdomainname.3
+++ b/lib/libc/gen/getdomainname.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getdomainname.3,v 1.5 1998/05/13 08:50:54 deraadt Exp $
+.\" $OpenBSD: getdomainname.3,v 1.6 1998/07/07 07:12:52 deraadt Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -53,8 +53,8 @@ The parameter
.Fa namelen
specifies the size of the
.Fa name
-array. The returned name is null-terminated unless insufficient
-space is provided.
+array. If insufficient space is provided, the returned name is truncated.
+The returned name is always null-terminated.
.Pp
.Fn Setdomainname
sets the domain name of the host machine to be
@@ -92,7 +92,11 @@ Domain names are limited to
.Dv MAXHOSTNAMELEN
(from
.Ao Pa sys/param.h Ac )
-characters, currently 256.
+characters, currently 256. This includes the terminating NUL character.
+.Pp
+If the buffer passed to
+.Fn getdomainname
+is too small, other operating systems may not gaurantee termination with NUL.
.Sh HISTORY
The
.Nm
diff --git a/lib/libc/gen/gethostname.3 b/lib/libc/gen/gethostname.3
index 881ba586e92..32b46fb9e1e 100644
--- a/lib/libc/gen/gethostname.3
+++ b/lib/libc/gen/gethostname.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gethostname.3,v 1.5 1998/05/13 08:50:56 deraadt Exp $
+.\" $OpenBSD: gethostname.3,v 1.6 1998/07/07 07:12:53 deraadt Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -53,8 +53,8 @@ The parameter
.Fa namelen
specifies the size of the
.Fa name
-array. The returned name is null-terminated unless insufficient
-space is provided.
+array. If insufficient space is provided, the returned name is truncated.
+The returned name is always null-terminated.
.Pp
.Fn Sethostname
sets the name of the host machine to be
@@ -90,9 +90,20 @@ Host names are limited to
.Dv MAXHOSTNAMELEN
(from
.Ao Pa sys/param.h Ac )
-characters, currently 256.
+characters, currently 256. This includes the terminating NUL character.
+.Pp
+If the buffer passed to
+.Fn getdomainname
+is smaller than
+.Dv MAXHOSTNAMELEN ,
+other operating systems may not gaurantee termination with NUL.
.Sh HISTORY
The
.Nm
function call appeared in
.Bx 4.2 .
+.Sh STANDARDS
+The
+.Nm
+function call conforms to
+.St -xpg4.2 .