diff options
author | tjr <tjr@FreeBSD.org> | 2003-09-27 08:14:37 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-09-27 08:14:37 +0000 |
commit | f428d37a308c54515acb8b7a169adb2a3ee03720 (patch) | |
tree | 31e88d1514c860c6218647a11f496a26426efaec /lib | |
parent | 81b27036384e098bceeed07ae1309bcc1e31c2e4 (diff) | |
download | FreeBSD-src-f428d37a308c54515acb8b7a169adb2a3ee03720.zip FreeBSD-src-f428d37a308c54515acb8b7a169adb2a3ee03720.tar.gz |
Use the 3-component version of the KERN_PROC_PROC sysctl.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 14228d5..4d4fa19 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -448,7 +448,8 @@ kvm_getprocs(kd, op, arg, cnt) mib[1] = KERN_PROC; mib[2] = op; mib[3] = arg; - st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, NULL, &size, NULL, 0); + st = sysctl(mib, op == KERN_PROC_ALL || op == KERN_PROC_PROC ? + 3 : 4, NULL, &size, NULL, 0); if (st == -1) { _kvm_syserr(kd, kd->program, "kvm_getprocs"); return (0); @@ -478,7 +479,8 @@ kvm_getprocs(kd, op, arg, cnt) _kvm_realloc(kd, kd->procbase, size); if (kd->procbase == 0) return (0); - st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, + st = sysctl(mib, op == KERN_PROC_ALL || + op == KERN_PROC_PROC ? 3 : 4, kd->procbase, &size, NULL, 0); } while (st == -1 && errno == ENOMEM); if (st == -1) { |