From 5a08a5653c9f944bba72da524fcd8fa5e3c23eb6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Tue, 16 Feb 2010 16:16:01 -0800 Subject: [PATCH] Calculate page size with getpagesize for armel --- src/node.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index 7f08f25..39c8f1a 100644 --- a/src/node.cc +++ b/src/node.cc @@ -612,7 +612,6 @@ int getmem(size_t *rss, size_t *vsize) { #ifdef __linux__ # define HAVE_GETMEM 1 # include /* for MAXPATHLEN */ -# include /* for PAGE_SIZE */ int getmem(size_t *rss, size_t *vsize) { FILE *f = fopen("/proc/self/stat", "r"); @@ -621,6 +620,7 @@ int getmem(size_t *rss, size_t *vsize) { int itmp; char ctmp; char buffer[MAXPATHLEN]; + size_t page_size = getpagesize(); /* PID */ if (fscanf(f, "%d ", &itmp) == 0) goto error; @@ -673,7 +673,7 @@ int getmem(size_t *rss, size_t *vsize) { /* Resident set size */ if (fscanf (f, "%u ", &itmp) == 0) goto error; - *rss = (size_t) itmp * PAGE_SIZE; + *rss = (size_t) itmp * page_size; /* rlim */ if (fscanf (f, "%u ", &itmp) == 0) goto error; -- 2.7.4