Use more fine grained HAVE macros instead of HAVE_PROCFS.

This commit is contained in:
antirez 2012-11-21 13:17:38 +01:00
parent 49b6452351
commit 3cb432837c
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,9 @@
/* Test for proc filesystem */
#ifdef __linux__
#define HAVE_PROCFS 1
#define HAVE_PROC_STAT 1
#define HAVE_PROC_MAPS 1
#define HAVE_PROC_SMAPS 1
#endif
/* Test for task_info() */

View File

@ -252,7 +252,7 @@ void zmalloc_set_oom_handler(void (*oom_handler)(size_t)) {
* function RedisEstimateRSS() that is a much faster (and less precise)
* version of the funciton. */
#if defined(HAVE_PROCFS)
#if defined(HAVE_PROC_STAT)
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -325,7 +325,7 @@ float zmalloc_get_fragmentation_ratio(void) {
return (float)zmalloc_get_rss()/zmalloc_used_memory();
}
#if defined(HAVE_PROCFS)
#if defined(HAVE_PROC_SMAPS)
size_t zmalloc_get_private_dirty(void) {
char line[1024];
size_t pd = 0;