ports/devel/nspr/files/patch-bug782124
Florian Smeets 2f4c3550c5 - update firefox and thunderbird to 15.0
- update firefox-esr, thunderbird-esr, linux-thunderbird and linux-firefox to 10.0.7
- update seamonkey and linux-seamonkey to 2.12
- update nss to 3.13.6
- update bsdipc code (posix_spawn, SysV shared memory)
- rename patches to easily track those not (yet) submitted upstream
- reduce package size, except for www/libxul[1]
- restore default objdir to what it was in 13.0
- fix mail/enigmail after thunderbird build changes
- don't accidentally pick up headers from installed ports[3]
- add support for PREFIX != LOCALBASE to Makefile.webplugins [4]
- document vulnerabilities in vuln.xml
- *miscellaneous cleanups and fixups*

Obtained from:	OpenBSD ports[1]
PR:		ports/159831, ports/160933, ports/170467[3], ports/170236 [4]
Submitted by:	avilla [4]
In collaboration with:	Jan Beich <jbeich@tormail.net> Who did most of the hard
			work.
2012-08-30 14:54:17 +00:00

37 lines
1 KiB
Text

--- ../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;