Commit 3b392fd3 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

need to move to portability layer. no statm on freebsd for example. addresses #1185

git-svn-id: file:///svn/toku/tokudb@6583 c7de825b-a66e-492c-adef-691d508d4ae1
parent fc3e8766
......@@ -582,9 +582,11 @@ static unsigned long check_maxrss (void) {
char fname[100];
snprintf(fname, sizeof(fname), "/proc/%d/statm", pid);
FILE *f = fopen(fname, "r");
unsigned long ignore, rss;
fscanf(f, "%lu %lu", &ignore, &rss);
fclose(f);
unsigned long ignore = 0, rss = 0;
if (f) {
fscanf(f, "%lu %lu", &ignore, &rss);
fclose(f);
}
if (toku_maxrss<rss) toku_maxrss=rss;
return rss;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment