summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sysctl.c11
-rw-r--r--sys/sys/sysctl.h6
2 files changed, 14 insertions, 3 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);
}
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 4eec998f10d..ca5f7dd9ca1 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.105 2010/07/26 01:56:27 guenther Exp $ */
+/* $OpenBSD: sysctl.h,v 1.106 2010/08/19 18:14:13 kettenis Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -189,7 +189,8 @@ struct ctlname {
#define KERN_CACHEPCT 72 /* buffer cache % of physmem */
#define KERN_FILE2 73 /* struct: file entries */
#define KERN_RTHREADS 74 /* kernel rthreads support enabled */
-#define KERN_MAXID 75 /* number of valid kern ids */
+#define KERN_CONSDEV 75 /* dev_t: console terminal device */
+#define KERN_MAXID 76 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
@@ -267,6 +268,7 @@ struct ctlname {
{ "bufcachepercent", CTLTYPE_INT }, \
{ "file2", CTLTYPE_STRUCT }, \
{ "rthreads", CTLTYPE_INT }, \
+ { "consdev", CTLTYPE_STRUCT }, \
}
/*