$OpenBSD: patch-j2se_src_solaris_native_com_sun_management_UnixOperatingSystem_md_c,v 1.1 2008/03/17 03:28:26 kurt Exp $
--- j2se/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c.orig	Sun Mar 16 09:33:26 2008
+++ j2se/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	Sun Mar 16 09:40:42 2008
@@ -324,12 +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;
 
-    mib[0] = CTL_HW;
-    mib[1] = HW_PHYSMEM;
     rlen = sizeof(result);
     if (sysctl(mib, 2, &result, &rlen, NULL, 0) == -1)
 	result = 256 * MB;
