diff options
Diffstat (limited to 'devel/nspr/files/patch-bug782124')
-rw-r--r-- | devel/nspr/files/patch-bug782124 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/devel/nspr/files/patch-bug782124 b/devel/nspr/files/patch-bug782124 new file mode 100644 index 000000000000..3f24011274d7 --- /dev/null +++ b/devel/nspr/files/patch-bug782124 @@ -0,0 +1,37 @@ +--- ../pr/src/misc/prsystem.c~ ++++ ../pr/src/misc/prsystem.c +@@ -24,7 +24,7 @@ + + /* BSD-derived systems use sysctl() to get the number of processors */ + #if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \ +- || defined(OPENBSD) || defined(DARWIN) ++ || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) + #define _PR_HAVE_SYSCTL + #include <sys/param.h> + #include <sys/sysctl.h> +@@ -292,15 +292,23 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) + if (pageSize >= 0 && pageCount >= 0) + bytes = (PRUint64) pageSize * pageCount; + +-#elif defined(NETBSD) || defined(OPENBSD) +- ++#elif defined(NETBSD) || defined(OPENBSD) \ ++ || defined(FREEBSD) || defined(DRAGONFLY) + int mib[2]; + int rc; ++#ifdef HW_PHYSMEM64 + uint64_t memSize; ++#else ++ unsigned long memSize; ++#endif + size_t len = sizeof(memSize); + + mib[0] = CTL_HW; ++#ifdef HW_PHYSMEM64 + mib[1] = HW_PHYSMEM64; ++#else ++ mib[1] = HW_PHYSMEM; ++#endif + rc = sysctl(mib, 2, &memSize, &len, NULL, 0); + if (-1 != rc) { + bytes = memSize; |