summaryrefslogtreecommitdiff
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
parenta8ef9a64c105b9c8c87ea83a801c7d08e2d6122d (diff)
support _SC_HOST_NAME_MAX; from brad
a libc crank is happening in < 24 hours
-rw-r--r--lib/libc/gen/sysconf.36
-rw-r--r--lib/libc/gen/sysconf.c6
-rw-r--r--sys/sys/unistd.h3
3 files changed, 11 insertions, 4 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:
{
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index ad44a421382..7a5b3ede8af 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.17 2010/01/15 10:17:48 sthen Exp $ */
+/* $OpenBSD: unistd.h,v 1.18 2010/10/28 02:05:59 deraadt Exp $ */
/* $NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $ */
/*
@@ -119,6 +119,7 @@
#define _SC_XOPEN_SHM 30
#define _SC_SEM_NSEMS_MAX 31
#define _SC_SEM_VALUE_MAX 32
+#define _SC_HOST_NAME_MAX 33
/* P1003.1c */
#define _SC_GETGR_R_SIZE_MAX 100