473cd14287
ok naddy@
31 lines
1005 B
Plaintext
31 lines
1005 B
Plaintext
$OpenBSD: patch-process_sysdep_OPENBSD_c,v 1.3 2008/02/28 18:30:08 okan Exp $
|
|
--- process/sysdep_OPENBSD.c.orig Sun Jul 29 16:23:26 2007
|
|
+++ process/sysdep_OPENBSD.c Wed Feb 27 13:26:37 2008
|
|
@@ -90,6 +90,7 @@ static long cpu_syst_old = 0;
|
|
int init_process_info_sysdep(void) {
|
|
int mib[2];
|
|
size_t len;
|
|
+ int64_t physmem;
|
|
struct clockinfo clock;
|
|
|
|
mib[0] = CTL_KERN;
|
|
@@ -112,14 +113,14 @@ int init_process_info_sysdep(void) {
|
|
return FALSE;
|
|
}
|
|
|
|
- mib[1] = HW_PHYSMEM;
|
|
- len = sizeof(systeminfo.mem_kbyte_max);
|
|
- if(sysctl(mib, 2, &systeminfo.mem_kbyte_max, &len, NULL, 0) == -1)
|
|
+ mib[1] = HW_PHYSMEM64;
|
|
+ len = sizeof(physmem);
|
|
+ if(sysctl(mib, 2, &physmem, &len, NULL, 0) == -1)
|
|
{
|
|
DEBUG("system statistic error -- cannot get real memory amount: %s\n", STRERROR);
|
|
return FALSE;
|
|
}
|
|
- systeminfo.mem_kbyte_max /= 1024;
|
|
+ systeminfo.mem_kbyte_max = physmem / 1024;
|
|
|
|
mib[1] = HW_PAGESIZE;
|
|
len = sizeof(pagesize_kbyte);
|