summaryrefslogtreecommitdiff
path: root/usr.sbin/sysctl
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-06-14 21:37:13 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-06-14 21:37:13 +0000
commitbe9e68b0d9cd84bf7310511b3e146b0895633780 (patch)
tree1210487499905b6cc8e78ab0d9c917ff6103bf6f /usr.sbin/sysctl
parentc7a19b401046a531612a627a73ed5aea7310eca9 (diff)
split the treatment of the random events
event_q by flipk@ spl fix by deraadt@ gother statistics about whole processing use 'sysctl kern.random' to view what had happened also fix wrong vm.psstrings description
Diffstat (limited to 'usr.sbin/sysctl')
-rw-r--r--usr.sbin/sysctl/sysctl.89
-rw-r--r--usr.sbin/sysctl/sysctl.c26
2 files changed, 30 insertions, 5 deletions
diff --git a/usr.sbin/sysctl/sysctl.8 b/usr.sbin/sysctl/sysctl.8
index 2a9e6fdbeb7..fa0511b8646 100644
--- a/usr.sbin/sysctl/sysctl.8
+++ b/usr.sbin/sysctl/sysctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.8,v 1.8 1997/06/13 13:50:59 mickey Exp $
+.\" $OpenBSD: sysctl.8,v 1.9 1997/06/14 21:37:11 mickey Exp $
.\" $NetBSD: sysctl.8,v 1.4 1995/09/30 07:12:49 thorpej Exp $
.\"
.\" Copyright (c) 1993
@@ -136,8 +136,9 @@ privilege can change the value.
.It kern.somaxconn integer yes
.It kern.sominconn integer yes
.It kern.usermount integer yes
+.It kern.random struct no
.It vm.loadavg struct no
-.It vm.psstrings struct _ps_strings no
+.It vm.psstrings struct no
.It fs.posix.setuid integer yes
.It net.inet.ip.forwarding integer yes
.It net.inet.ip.redirect integer yes
@@ -226,6 +227,10 @@ sysctl vm.loadavg
.It Pa <sys/sysctl.h>
definitions for top level identifiers, second level kernel and hardware
identifiers, and user level identifiers
+.It Pa <dev/rndvar.h>
+definitions for
+.Xr random 4
+device's statistics structure
.It Pa <sys/socket.h>
definitions for second level network identifiers
.It Pa <sys/gmon.h>
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index a4867ee0deb..196026e9414 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.7 1997/04/06 20:19:22 millert Exp $ */
+/* $OpenBSD: sysctl.c,v 1.8 1997/06/14 21:37:12 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.7 1997/04/06 20:19:22 millert Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.8 1997/06/14 21:37:12 mickey Exp $";
#endif
#endif /* not lint */
@@ -72,6 +72,7 @@ static char *rcsid = "$OpenBSD: sysctl.c,v 1.7 1997/04/06 20:19:22 millert Exp $
#include <netipx/ipx_var.h>
#include <netipx/spx_var.h>
#include <ddb/db_var.h>
+#include <dev/rndvar.h>
#include <errno.h>
#include <stdio.h>
@@ -123,6 +124,7 @@ int Aflag, aflag, nflag, wflag;
#define CLOCK 0x00000001
#define BOOTTIME 0x00000002
#define CONSDEV 0x00000004
+#define RNDSTATS 0x00000008
/* prototypes */
void usage();
@@ -272,7 +274,7 @@ parse(string, flags)
return;
if (!nflag)
fprintf(stdout, "%s: ", string);
- fprintf(stderr,
+ fprintf(stdout,
"kernel is not compiled for profiling\n");
return;
}
@@ -305,6 +307,9 @@ parse(string, flags)
case KERN_BOOTTIME:
special |= BOOTTIME;
break;
+ case KERN_RND:
+ special |= RNDSTATS;
+ break;
}
break;
@@ -453,6 +458,21 @@ parse(string, flags)
fprintf(stdout, "0x%x\n", dev);
return;
}
+ if (special & RNDSTATS) {
+ struct rndstats *rndstats = (struct rndstats *)buf;
+ if (!nflag)
+ fprintf(stdout, "%s: ", string);
+ fprintf(stdout,
+ "%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ rndstats->rnd_total, rndstats->rnd_used,
+ rndstats->arc4_reads, rndstats->rnd_timer,
+ rndstats->rnd_mouse, rndstats->rnd_tty,
+ rndstats->rnd_disk, rndstats->rnd_net,
+ rndstats->rnd_reads, rndstats->rnd_waits,
+ rndstats->rnd_enqs, rndstats->rnd_deqs,
+ rndstats->rnd_drops);
+ return;
+ }
switch (type) {
case CTLTYPE_INT:
if (newsize == 0) {