summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 4973cf62f25..67fecfb42ee 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.191 2010/07/26 01:56:27 guenther Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.192 2010/08/19 18:14:14 kettenis Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -77,6 +77,8 @@
#include <sys/mount.h>
#include <sys/syscallargs.h>
+
+#include <dev/cons.h>
#include <dev/rndvar.h>
#include <dev/systrace.h>
@@ -256,6 +258,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
size_t newlen, struct proc *p)
{
int error, level, inthostid, stackgap;
+ dev_t dev;
extern int somaxconn, sominconn;
extern int usermount, nosuidcoredump;
extern long cp_time[CPUSTATES];
@@ -576,6 +579,12 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
}
return(0);
}
+ case KERN_CONSDEV:
+ if (cn_tab != NULL)
+ dev = cn_tab->cn_dev;
+ else
+ dev = NODEV;
+ return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
default:
return (EOPNOTSUPP);
}