]> git.saurik.com Git - redis.git/commitdiff
ifdefs added to use kevent on Free Open and Net BSD as well. INFO and ae.c modified...
authorantirez <antirez@gmail.com>
Sat, 28 Nov 2009 16:06:28 +0000 (17:06 +0100)
committerantirez <antirez@gmail.com>
Sat, 28 Nov 2009 16:06:28 +0000 (17:06 +0100)
ae.c
ae.h
ae_epoll.c
ae_kqueue.c
ae_select.c
config.h
redis.c
test-redis.tcl

diff --git a/ae.c b/ae.c
index 048fa51c4ee50ea01eb503bb9fd1805bb99e0c05..81fd9add8f15fa63b4e4ed669967b193ca523f74 100644 (file)
--- a/ae.c
+++ b/ae.c
@@ -373,9 +373,12 @@ int aeWait(int fd, int mask, long long milliseconds) {
     }
 }
 
-void aeMain(aeEventLoop *eventLoop)
-{
+void aeMain(aeEventLoop *eventLoop) {
     eventLoop->stop = 0;
     while (!eventLoop->stop)
         aeProcessEvents(eventLoop, AE_ALL_EVENTS);
 }
+
+char *aeGetApiName(void) {
+    return aeApiName();
+}
diff --git a/ae.h b/ae.h
index 499063ca962dd1381d1848b375ad1a71a9edbad1..0a056ce917a6931e2fc390e87f4bfc8b16da1479 100644 (file)
--- a/ae.h
+++ b/ae.h
@@ -111,5 +111,6 @@ int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id);
 int aeProcessEvents(aeEventLoop *eventLoop, int flags);
 int aeWait(int fd, int mask, long long milliseconds);
 void aeMain(aeEventLoop *eventLoop);
+char *aeGetApiName(void);
 
 #endif
index 8fb5d4c38aafd6ea0be50e49d87e8d1a9111fb8d..f6371b0befebdfbfbed83bc9873439932cdd556f 100644 (file)
@@ -85,3 +85,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
     }
     return numevents;
 }
+
+static char *aeApiName(void) {
+    return "epoll";
+}
index 6408e3222d2aeea96d757d8658309e91499c6fce..04c3536ba7f80892ef00cfaa20d6a109776d0e15 100644 (file)
@@ -87,3 +87,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
     }
     return numevents;
 }
+
+static char *aeApiName(void) {
+    return "kqueue";
+}
index 2f7185b0a9290ca1eab6b1f00b1570d1aab0ed1d..11fd719aa62ee93fabb453dd0b21abfd0208af75 100644 (file)
@@ -72,3 +72,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
     }
     return numevents;
 }
+
+static char *aeApiName(void) {
+    return "select";
+}
index 86e943dd9e13ada3f2b5d6daa9d14949ee9d4454..7cf0f0a30778e2bb0411e3981c89425f77133976 100644 (file)
--- a/config.h
+++ b/config.h
@@ -31,7 +31,7 @@
 #define HAVE_EPOLL 1
 #endif
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
 #define HAVE_KQUEUE 1
 #endif
 
diff --git a/redis.c b/redis.c
index 1236d9b5bff0c4e4bdde13692cfd73a1758a79e2..56ee1496354a58524c76506bca56193233159338 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -5018,6 +5018,7 @@ static void infoCommand(redisClient *c) {
     info = sdscatprintf(sdsempty(),
         "redis_version:%s\r\n"
         "arch_bits:%s\r\n"
+        "multiplexing_api:%s\r\n"
         "uptime_in_seconds:%d\r\n"
         "uptime_in_days:%d\r\n"
         "connected_clients:%d\r\n"
@@ -5031,6 +5032,7 @@ static void infoCommand(redisClient *c) {
         "role:%s\r\n"
         ,REDIS_VERSION,
         (sizeof(long) == 8) ? "64" : "32",
+        aeGetApiName(),
         uptime,
         uptime/(3600*24),
         listLength(server.clients)-listLength(server.slaves),
index 00850c8151da6caf72e8085a206fb2865a71d94d..354016e03bbc2f1875e2a8ef57b914f559ec996e 100644 (file)
@@ -1,4 +1,7 @@
-# TODO # test pipelining
+# test-redis.tcl
+# Redis test suite. Copyright (C) 2009 Salvatore Sanfilippo antirez@gmail.com
+# This softare is released under the BSD License. See the COPYING file for
+# more information.
 
 set tcl_precision 17
 source redis.tcl