]> git.saurik.com Git - redis.git/blob - src/config.h
maxmemory fixed, we now try to release memory just before we check for the memory...
[redis.git] / src / config.h
1 #ifndef __CONFIG_H
2 #define __CONFIG_H
3
4 #ifdef __APPLE__
5 #include <AvailabilityMacros.h>
6 #endif
7
8 /* test for malloc_size() */
9 #ifdef __APPLE__
10 #include <malloc/malloc.h>
11 #define HAVE_MALLOC_SIZE 1
12 #define redis_malloc_size(p) malloc_size(p)
13 #endif
14
15 /* define redis_fstat to fstat or fstat64() */
16 #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
17 #define redis_fstat fstat64
18 #define redis_stat stat64
19 #else
20 #define redis_fstat fstat
21 #define redis_stat stat
22 #endif
23
24 /* test for proc filesystem */
25 #ifdef __linux__
26 #define HAVE_PROCFS 1
27 #endif
28
29 /* test for task_info() */
30 #if defined(__APPLE__)
31 #define HAVE_TASKINFO 1
32 #endif
33
34 /* test for backtrace() */
35 #if defined(__APPLE__) || defined(__linux__)
36 #define HAVE_BACKTRACE 1
37 #endif
38
39 /* test for polling API */
40 #ifdef __linux__
41 #define HAVE_EPOLL 1
42 #endif
43
44 #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
45 #define HAVE_KQUEUE 1
46 #endif
47
48 /* define aof_fsync to fdatasync() in Linux and fsync() for all the rest */
49 #ifdef __linux__
50 #define aof_fsync fdatasync
51 #else
52 #define aof_fsync fsync
53 #endif
54
55 #endif