aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2005-12-05 06:33:55 +0800
committermarcus <marcus@FreeBSD.org>2005-12-05 06:33:55 +0800
commita920cfaa09a78ba42c274758c7cb627a80f620dd (patch)
tree41d7e5e03c6566b55dcd1cd6f188dcce23a41fc9 /devel
parent9312c2edc5e5bb2bcfabb03fed958215d88662ac (diff)
downloadfreebsd-ports-gnome-a920cfaa09a78ba42c274758c7cb627a80f620dd.tar.gz
freebsd-ports-gnome-a920cfaa09a78ba42c274758c7cb627a80f620dd.tar.zst
freebsd-ports-gnome-a920cfaa09a78ba42c274758c7cb627a80f620dd.zip
Implement the PR_GetPhysicalMemorySize function for FreeBSD. This will
allow applications such as Firefox to enable memory caching. PR: 89946 Submitted by: Juha-Matti Tilli <juhis@nallukka.net> (with some modifications)
Diffstat (limited to 'devel')
-rw-r--r--devel/nspr/Makefile2
-rw-r--r--devel/nspr/files/patch-.._pr_src_misc_prsystem.c22
2 files changed, 23 insertions, 1 deletions
diff --git a/devel/nspr/Makefile b/devel/nspr/Makefile
index 2cc75ac3130d..b94e69605de3 100644
--- a/devel/nspr/Makefile
+++ b/devel/nspr/Makefile
@@ -7,7 +7,7 @@
PORTNAME= nspr
PORTVERSION= 4.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_MOZILLA}
MASTER_SITE_SUBDIR= nspr/releases/v${PORTVERSION}/src
diff --git a/devel/nspr/files/patch-.._pr_src_misc_prsystem.c b/devel/nspr/files/patch-.._pr_src_misc_prsystem.c
new file mode 100644
index 000000000000..a73a823f40b5
--- /dev/null
+++ b/devel/nspr/files/patch-.._pr_src_misc_prsystem.c
@@ -0,0 +1,22 @@
+--- ../pr/src/misc/prsystem.c.orig Fri May 6 20:35:58 2005
++++ ../pr/src/misc/prsystem.c Sun Dec 4 22:09:51 2005
+@@ -352,6 +352,19 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMem
+ odm_terminate();
+ }
+
++#elif defined(__FreeBSD__)
++
++ int mib[2];
++ unsigned long physmem;
++ size_t len;
++
++ mib[0] = CTL_HW;
++ mib[1] = HW_PHYSMEM;
++ len = sizeof(physmem);
++ if(sysctl(mib, 2, &physmem, &len, NULL, 0) == 0
++ && len == sizeof(physmem))
++ bytes = physmem;
++
+ #else
+
+ PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);