summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-10-28 02:06:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-10-28 02:06:01 +0000
commit672575904a64f0cd0a4f01da9300724b6f729ce0 (patch)
tree7930ed9a5a944a65d0721a54e97820d70ceffe86 /lib/libc
parenta8ef9a64c105b9c8c87ea83a801c7d08e2d6122d (diff)
support _SC_HOST_NAME_MAX; from brad
a libc crank is happening in < 24 hours
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysconf.36
-rw-r--r--lib/libc/gen/sysconf.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/gen/sysconf.3 b/lib/libc/gen/sysconf.3
index 74109d1cb1f..801461ee7f4 100644
--- a/lib/libc/gen/sysconf.3
+++ b/lib/libc/gen/sysconf.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysconf.3,v 1.27 2010/02/22 17:54:52 jmc Exp $
+.\" $OpenBSD: sysconf.3,v 1.28 2010/10/28 02:06:00 deraadt Exp $
.\"
.\" Copyright (c) 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: February 22 2010 $
+.Dd $Mdocdate: October 28 2010 $
.Dt SYSCONF 3
.Os
.Sh NAME
@@ -172,6 +172,8 @@ The level of support for thread-safe (re-entrant) functions.
The number of processors configured.
.It Li _SC_NPROCESSORS_ONLN
The number of processors online (capable of running processes).
+.It Li _SC_HOST_NAME_MAX
+The maximum size of a hostname, not counting NULL.
.El
.Sh RETURN VALUES
If the call to
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 97adeed047c..ce4f89a0b44 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysconf.c,v 1.11 2010/01/15 08:35:47 sthen Exp $ */
+/* $OpenBSD: sysconf.c,v 1.12 2010/10/28 02:06:00 deraadt Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -214,6 +214,10 @@ yesno: if (sysctl(mib, namelen, &value, &len, NULL, 0) == -1)
namelen = 3;
break;
+/* Unsorted */
+ case _SC_HOST_NAME_MAX:
+ return (MAXHOSTNAMELEN - 1); /* does not include \0 */
+
/* Extensions */
case _SC_PHYS_PAGES:
{