583cd757dd
- fix following kinfo_proc2 removal
25 lines
939 B
Plaintext
25 lines
939 B
Plaintext
$OpenBSD: patch-src_platform_openbsd_cc,v 1.1 2012/01/10 14:35:56 sthen Exp $
|
|
--- src/platform_openbsd.cc.orig Tue Jan 10 13:45:30 2012
|
|
+++ src/platform_openbsd.cc Tue Jan 10 13:57:13 2012
|
|
@@ -68,9 +68,9 @@ const char* Platform::GetProcessTitle(int *len) {
|
|
|
|
int Platform::GetMemory(size_t *rss) {
|
|
kvm_t *kd = NULL;
|
|
- struct kinfo_proc2 *kinfo = NULL;
|
|
+ struct kinfo_proc *kinfo = NULL;
|
|
pid_t pid;
|
|
- int nprocs, max_size = sizeof(struct kinfo_proc2);
|
|
+ int nprocs, max_size = sizeof(struct kinfo_proc);
|
|
size_t page_size = getpagesize();
|
|
|
|
pid = getpid();
|
|
@@ -78,7 +78,7 @@ int Platform::GetMemory(size_t *rss) {
|
|
kd = kvm_open(NULL, _PATH_MEM, NULL, O_RDONLY, "kvm_open");
|
|
if (kd == NULL) goto error;
|
|
|
|
- kinfo = kvm_getproc2(kd, KERN_PROC_PID, pid, max_size, &nprocs);
|
|
+ kinfo = kvm_getprocs(kd, KERN_PROC_PID, pid, max_size, &nprocs);
|
|
if (kinfo == NULL) goto error;
|
|
|
|
*rss = kinfo->p_vm_rssize * page_size;
|