summaryrefslogtreecommitdiff
path: root/usr.sbin/sysctl/sysctl.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-16 03:57:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-16 03:57:32 +0000
commit1c4e45d5c2aad6aff1405a367f524f5d1a77e660 (patch)
tree67785c74327b982dc7b7f34d72ab2ee7e31cad00 /usr.sbin/sysctl/sysctl.c
parentb678783cd46296b4fd2498113aecbbcac3aa8ef8 (diff)
Support VM_PSSTRINGS. Man, this has been sitting in my tree for a while...
Diffstat (limited to 'usr.sbin/sysctl/sysctl.c')
-rw-r--r--usr.sbin/sysctl/sysctl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index 799c15dd686..5e399658acc 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.5 1997/01/15 23:44:22 millert Exp $ */
+/* $OpenBSD: sysctl.c,v 1.6 1997/01/16 03:57:31 millert 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.5 1997/01/15 23:44:22 millert Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.6 1997/01/16 03:57:31 millert Exp $";
#endif
#endif /* not lint */
@@ -321,6 +321,15 @@ parse(string, flags)
fprintf(stdout, "%.2f %.2f %.2f\n",
loads[0], loads[1], loads[2]);
return;
+ } else if (mib[1] == VM_PSSTRINGS) {
+ struct _ps_strings _ps;
+
+ len = sizeof(_ps);
+ sysctl(mib, 2, &_ps, &len, NULL, 0);
+ if (!nflag)
+ fprintf(stdout, "%s: ", string);
+ fprintf(stdout, "%ld\n", _ps.val);
+ return;
}
if (flags == 0)
return;