diff options
author | phk <phk@FreeBSD.org> | 1996-06-06 17:16:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-06-06 17:16:52 +0000 |
commit | c6eabb927488269337f3da1d06a644ee7f8305cc (patch) | |
tree | 7cea6d5d67d6bd561ff49de66bfa861684f7b2a1 /lib/libkvm/kvm_proc.c | |
parent | 03fe6f9d6d014c471e741acc4e30ac008d49f4fa (diff) | |
download | FreeBSD-src-c6eabb927488269337f3da1d06a644ee7f8305cc.zip FreeBSD-src-c6eabb927488269337f3da1d06a644ee7f8305cc.tar.gz |
Pass correct length OID to kernel for KERN_PROC_ALL.
Diffstat (limited to 'lib/libkvm/kvm_proc.c')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index fe36f3e..bb352d3 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -280,7 +280,7 @@ kvm_getprocs(kd, op, arg, cnt) mib[1] = KERN_PROC; mib[2] = op; mib[3] = arg; - st = sysctl(mib, 4, NULL, &size, NULL, 0); + st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, NULL, &size, NULL, 0); if (st == -1) { _kvm_syserr(kd, kd->program, "kvm_getprocs"); return (0); @@ -288,7 +288,7 @@ kvm_getprocs(kd, op, arg, cnt) kd->procbase = (struct kinfo_proc *)_kvm_malloc(kd, size); if (kd->procbase == 0) return (0); - st = sysctl(mib, 4, kd->procbase, &size, NULL, 0); + st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, kd->procbase, &size, NULL, 0); if (st == -1) { _kvm_syserr(kd, kd->program, "kvm_getprocs"); return (0); |