From 038ba33cd869a34cadb4a01722f04bca595bd4b0 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Thu, 1 Apr 1993 00:27:39 -0800 Subject: [PATCH] convert from kinfo to sysctl SCCS-vsn: usr.bin/vmstat/vmstat.c 5.42 SCCS-vsn: usr.bin/gcore/md-nop.c 5.4 SCCS-vsn: usr.bin/gcore/md-sparc.c 5.3 SCCS-vsn: usr.bin/gcore/gcore.c 5.15 --- usr/src/usr.bin/gcore/gcore.c | 6 +++--- usr/src/usr.bin/gcore/md-nop.c | 3 +-- usr/src/usr.bin/gcore/md-sparc.c | 3 +-- usr/src/usr.bin/vmstat/vmstat.c | 10 ++++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/usr/src/usr.bin/gcore/gcore.c b/usr/src/usr.bin/gcore/gcore.c index 322dcdd7c9..66078df1f5 100644 --- a/usr/src/usr.bin/gcore/gcore.c +++ b/usr/src/usr.bin/gcore/gcore.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)gcore.c 5.14 (Berkeley) %G%"; +static char sccsid[] = "@(#)gcore.c 5.15 (Berkeley) %G%"; #endif /* not lint */ /* @@ -32,7 +32,7 @@ static char sccsid[] = "@(#)gcore.c 5.14 (Berkeley) %G%"; #include #include #include -#include +#include #include #include @@ -97,7 +97,7 @@ main(argc, argv) uid = getuid(); pid = atoi(argv[1]); - ki = kvm_getprocs(kd, KINFO_PROC_PID, pid, &cnt); + ki = kvm_getprocs(kd, KERN_PROC_PID, pid, &cnt); if (ki == NULL || cnt != 1) err(1, "%d: not found", pid); diff --git a/usr/src/usr.bin/gcore/md-nop.c b/usr/src/usr.bin/gcore/md-nop.c index 11e0dbb2c7..e00ef36d83 100644 --- a/usr/src/usr.bin/gcore/md-nop.c +++ b/usr/src/usr.bin/gcore/md-nop.c @@ -6,11 +6,10 @@ */ #ifndef lint -static char sccsid[] = "@(#)md-nop.c 5.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)md-nop.c 5.4 (Berkeley) %G%"; #endif /* not lint */ #include -#include #include #include diff --git a/usr/src/usr.bin/gcore/md-sparc.c b/usr/src/usr.bin/gcore/md-sparc.c index c9be14f101..9a772761a3 100644 --- a/usr/src/usr.bin/gcore/md-sparc.c +++ b/usr/src/usr.bin/gcore/md-sparc.c @@ -10,7 +10,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)md-sparc.c 5.2 (Berkeley) %G%"; +static char sccsid[] = "@(#)md-sparc.c 5.3 (Berkeley) %G%"; #endif /* not lint */ #include @@ -19,7 +19,6 @@ static char sccsid[] = "@(#)md-sparc.c 5.2 (Berkeley) %G%"; #include #include #include -#include #include #include diff --git a/usr/src/usr.bin/vmstat/vmstat.c b/usr/src/usr.bin/vmstat/vmstat.c index aef2077d1b..de46e9b6aa 100644 --- a/usr/src/usr.bin/vmstat/vmstat.c +++ b/usr/src/usr.bin/vmstat/vmstat.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)vmstat.c 5.41 (Berkeley) %G%"; +static char sccsid[] = "@(#)vmstat.c 5.42 (Berkeley) %G%"; #endif /* not lint */ #include @@ -26,7 +26,7 @@ static char sccsid[] = "@(#)vmstat.c 5.41 (Berkeley) %G%"; #include #include #include -#include +#include #include #include #include @@ -366,7 +366,7 @@ dovmstat(interval, reps) struct vmtotal total; time_t uptime, halfuptime; void needhdr(); - int size; + int mib[2], size; uptime = getuptime(); halfuptime = uptime / 2; @@ -384,7 +384,9 @@ dovmstat(interval, reps) kread(X_DKXFER, cur.xfer, sizeof(*cur.xfer) * dk_ndrive); kread(X_SUM, &sum, sizeof(sum)); size = sizeof(total); - if (getkerninfo(KINFO_METER, &total, &size, 0) < 0) { + mib[0] = CTL_VM; + mib[1] = VM_METER; + if (sysctl(mib, 2, &total, &size, NULL, 0) < 0) { printf("Can't get kerninfo: %s\n", strerror(errno)); bzero(&total, sizeof(total)); } -- 2.20.1