diff options
-rw-r--r-- | sbin/sysctl/sysctl.c | 21 | ||||
-rw-r--r-- | usr.sbin/sysctl/sysctl.c | 21 |
2 files changed, 38 insertions, 4 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index eb52b09be03..5be2072599f 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.39 1999/04/11 19:41:41 niklas Exp $ */ +/* $OpenBSD: sysctl.c,v 1.40 1999/07/01 15:45:18 deraadt 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.5 (Berkeley) 5/9/95"; #else -static char *rcsid = "$OpenBSD: sysctl.c,v 1.39 1999/04/11 19:41:41 niklas Exp $"; +static char *rcsid = "$OpenBSD: sysctl.c,v 1.40 1999/07/01 15:45:18 deraadt Exp $"; #endif #endif /* not lint */ @@ -144,6 +144,7 @@ int Aflag, aflag, nflag, wflag; #define BIOSGEO 0x00000040 #define BIOSDEV 0x00000080 #define MAJ2DEV 0x00000100 +#define UNSIGNED 0x00000200 /* prototypes */ void debuginit __P((void)); @@ -328,6 +329,9 @@ parse(string, flags) case KERN_RND: special |= RNDSTATS; break; + case KERN_ARND: + special |= UNSIGNED; + break; } break; @@ -581,6 +585,19 @@ parse(string, flags) return; } #endif + if (special & UNSIGNED) { + if (newsize == 0) { + if (!nflag) + (void)printf("%s = ", string); + (void)printf("%u\n", *(u_int *)buf); + } else { + if (!nflag) + (void)printf("%s: %u -> ", string, + *(u_int *)buf); + (void)printf("%u\n", *(u_int *)newval); + } + 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 eb52b09be03..5be2072599f 100644 --- a/usr.sbin/sysctl/sysctl.c +++ b/usr.sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.39 1999/04/11 19:41:41 niklas Exp $ */ +/* $OpenBSD: sysctl.c,v 1.40 1999/07/01 15:45:18 deraadt 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.5 (Berkeley) 5/9/95"; #else -static char *rcsid = "$OpenBSD: sysctl.c,v 1.39 1999/04/11 19:41:41 niklas Exp $"; +static char *rcsid = "$OpenBSD: sysctl.c,v 1.40 1999/07/01 15:45:18 deraadt Exp $"; #endif #endif /* not lint */ @@ -144,6 +144,7 @@ int Aflag, aflag, nflag, wflag; #define BIOSGEO 0x00000040 #define BIOSDEV 0x00000080 #define MAJ2DEV 0x00000100 +#define UNSIGNED 0x00000200 /* prototypes */ void debuginit __P((void)); @@ -328,6 +329,9 @@ parse(string, flags) case KERN_RND: special |= RNDSTATS; break; + case KERN_ARND: + special |= UNSIGNED; + break; } break; @@ -581,6 +585,19 @@ parse(string, flags) return; } #endif + if (special & UNSIGNED) { + if (newsize == 0) { + if (!nflag) + (void)printf("%s = ", string); + (void)printf("%u\n", *(u_int *)buf); + } else { + if (!nflag) + (void)printf("%s: %u -> ", string, + *(u_int *)buf); + (void)printf("%u\n", *(u_int *)newval); + } + return; + } if (special & RNDSTATS) { struct rndstats *rndstats = (struct rndstats *)buf; |