summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2013-09-03 10:03:08 -0700
committerChris Buechler <cmb@pfsense.org>2013-09-03 10:03:08 -0700
commit96551a20bae80cf791bd25e2e0a1cd0cc48cb32b (patch)
treeb9268adc4f683d555447f053d09a42a30a4a209a /etc/inc/util.inc
parentc9d099d788071ad944d47676e086da91faf7faf3 (diff)
parente9215ad443d485a1fc7c2fa3a065025539ede861 (diff)
downloadpfsense-96551a20bae80cf791bd25e2e0a1cd0cc48cb32b.zip
pfsense-96551a20bae80cf791bd25e2e0a1cd0cc48cb32b.tar.gz
Merge pull request #794 from phil-davis/RELENG_2_1
Backport get_memory changes to 2.1
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 6a62563..80efd9b 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1514,14 +1514,15 @@ function set_sysctl($values) {
* get_memory()
* returns an array listing the amount of
* memory installed in the hardware
- * [0]real and [1]available
+ * [0] net memory available for the OS (FreeBSD) after some is taken by BIOS, video or whatever - e.g. 235 MBytes
+ * [1] real (actual) memory of the system, should be the size of the RAM card/s - e.g. 256 MBytes
*/
function get_memory() {
- $real = trim(`sysctl -n hw.physmem`, " \n");
- $avail = trim(`sysctl -n hw.realmem`, " \n");
+ $physmem = trim(`sysctl -n hw.physmem`, " \n");
+ $realmem = trim(`sysctl -n hw.realmem`, " \n");
/* convert from bytes to megabytes */
- return array(($real/1048576),($avail/1048576));
+ return array(($physmem/1048576),($realmem/1048576));
}
function mute_kernel_msgs() {
OpenPOWER on IntegriCloud