$OpenBSD: patch-j2se_src_solaris_native_com_sun_management_UnixOperatingSystem_md_c,v 1.3 2008/03/17 03:21:25 kurt Exp $
--- j2se/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c.orig	Wed Feb 27 08:06:56 2008
+++ j2se/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	Thu Feb 28 10:26:32 2008
@@ -324,13 +324,15 @@ Java_com_sun_management_UnixOperatingSystem_getTotalPh
   (JNIEnv *env, jobject mbean)
 {
 #ifdef _ALLBSD_SOURCE
+#ifdef HW_PHYSMEM64
+    int64_t result;
+    int mib[2] = { CTL_HW, HW_PHYSMEM64 };
+#else
     unsigned long result;
-    int mib[2];
-    int rlen;
+    int mib[2] = { CTL_HW, HW_PHYSMEM };
+#endif
+    size_t rlen = sizeof(result);
 
-    mib[0] = CTL_HW;
-    mib[1] = HW_PHYSMEM;
-    rlen = sizeof(result);
     if (sysctl(mib, 2, &result, &rlen, NULL, 0) == -1)
 	result = 256 * MB;
 
