summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-24 20:26:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-24 20:26:25 +0000
commitcdf90eb1cc9cfb9d03d61c5df17a6e3b9d8799e1 (patch)
tree957bc998cac6cf589d22af94eaef399f757b7578
parenta8343af6bc0742bb3e8063e88dd4dff0e1915033 (diff)
support CPU_CHR2BLK sysctl
-rw-r--r--sys/arch/amd64/amd64/machdep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index fb3b6147b68..1f1d24be232 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.10 2004/02/24 00:20:45 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.11 2004/02/24 20:26:24 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -546,6 +546,7 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
struct proc *p;
{
dev_t consdev;
+ dev_t dev;
/* all sysctl names at this level are terminal */
if (namelen != 1)
@@ -559,7 +560,11 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
consdev = NODEV;
return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
sizeof consdev));
-
+ case CPU_CHR2BLK:
+ if (namelen != 2)
+ return (ENOTDIR); /* overloaded */
+ dev = chrtoblk((dev_t)name[1]);
+ return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
case CPU_ALLOWAPERTURE:
#ifdef APERTURE
if (securelevel > 0)