diff options
author | 1997-08-28 19:39:20 +0000 | |
---|---|---|
committer | 1997-08-28 19:39:20 +0000 | |
commit | 65534d8cd1bb6f9c629f798b67d18be316c928c0 (patch) | |
tree | 73b3233f6dd8bc50c72e8eb1ab860df9eb986ec1 | |
parent | grok bios geometry (diff) | |
download | wireguard-openbsd-65534d8cd1bb6f9c629f798b67d18be316c928c0.tar.xz wireguard-openbsd-65534d8cd1bb6f9c629f798b67d18be316c928c0.zip |
symbolic bios bootdev, s/hpc/tpc/ for bios geonetry
-rw-r--r-- | sbin/sysctl/sysctl.c | 23 | ||||
-rw-r--r-- | usr.sbin/sysctl/sysctl.c | 23 |
2 files changed, 40 insertions, 6 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index f488cec1168..2e1dae8cdd2 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.22 1997/08/28 19:31:51 mickey Exp $ */ +/* $OpenBSD: sysctl.c,v 1.23 1997/08/28 19:39:20 mickey Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: sysctl.c,v 1.22 1997/08/28 19:31:51 mickey Exp $"; +static char *rcsid = "$OpenBSD: sysctl.c,v 1.23 1997/08/28 19:39:20 mickey Exp $"; #endif #endif /* not lint */ @@ -137,6 +137,7 @@ int Aflag, aflag, nflag, wflag; #define RNDSTATS 0x00000008 #define BADDYNAMIC 0x00000010 #define BIOSGEO 0x00000020 +#define BIOSDEV 0x00000040 /* prototypes */ void debuginit __P((void)); @@ -404,6 +405,10 @@ parse(string, flags) if (mib[1] == CPU_BIOSGEOMETRY) special |= BIOSGEO; #endif +#ifdef CPU_BIOSDEV + if (mib[1] == CPU_BIOSDEV) + special |= BIOSDEV; +#endif break; case CTL_FS: @@ -495,10 +500,22 @@ parse(string, flags) if (!nflag) (void)printf("%s = ", string); - (void) printf("spt = %d, hpc = %d\n", + (void) printf("spt = %d, tpc = %d\n", BIOSNSECTS(geo), BIOSNHEADS(geo)); return; } + if (special & BIOSDEV) { + int dev = *(int*)buf; + + if (!nflag) + (void)printf("%s = ", string); + if (dev & 0x80) + dev = 'c' + dev & 0x7f; + else + dev += 'a'; + (void) printf("%c:\n", dev); + return; + } if (special & RNDSTATS) { struct rndstats *rndstats = (struct rndstats *)buf; diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c index f488cec1168..2e1dae8cdd2 100644 --- a/usr.sbin/sysctl/sysctl.c +++ b/usr.sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.22 1997/08/28 19:31:51 mickey Exp $ */ +/* $OpenBSD: sysctl.c,v 1.23 1997/08/28 19:39:20 mickey Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: sysctl.c,v 1.22 1997/08/28 19:31:51 mickey Exp $"; +static char *rcsid = "$OpenBSD: sysctl.c,v 1.23 1997/08/28 19:39:20 mickey Exp $"; #endif #endif /* not lint */ @@ -137,6 +137,7 @@ int Aflag, aflag, nflag, wflag; #define RNDSTATS 0x00000008 #define BADDYNAMIC 0x00000010 #define BIOSGEO 0x00000020 +#define BIOSDEV 0x00000040 /* prototypes */ void debuginit __P((void)); @@ -404,6 +405,10 @@ parse(string, flags) if (mib[1] == CPU_BIOSGEOMETRY) special |= BIOSGEO; #endif +#ifdef CPU_BIOSDEV + if (mib[1] == CPU_BIOSDEV) + special |= BIOSDEV; +#endif break; case CTL_FS: @@ -495,10 +500,22 @@ parse(string, flags) if (!nflag) (void)printf("%s = ", string); - (void) printf("spt = %d, hpc = %d\n", + (void) printf("spt = %d, tpc = %d\n", BIOSNSECTS(geo), BIOSNHEADS(geo)); return; } + if (special & BIOSDEV) { + int dev = *(int*)buf; + + if (!nflag) + (void)printf("%s = ", string); + if (dev & 0x80) + dev = 'c' + dev & 0x7f; + else + dev += 'a'; + (void) printf("%c:\n", dev); + return; + } if (special & RNDSTATS) { struct rndstats *rndstats = (struct rndstats *)buf; |