From: millert Date: Thu, 16 Jan 1997 03:57:31 +0000 (+0000) Subject: Support VM_PSSTRINGS. Man, this has been sitting in my tree for a while... X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bfe1150a20380d47412e7f986ce6b8455c73379a;p=openbsd Support VM_PSSTRINGS. Man, this has been sitting in my tree for a while... --- diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 799c15dd686..5e399658acc 100644 --- a/sbin/sysctl/sysctl.c +++ b/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; 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;