From: Chris Lamb <lamby@debian.org>
Date: Wed, 2 Jan 2019 17:12:22 +0000
Subject: Define CLOCK_MONOTONIC_RAW for kFreeBSD.

---
 src/aggregate/aggregate_exec.c | 4 ++++
 src/concurrent_ctx.c           | 6 +++++-
 src/query_plan.c               | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/aggregate/aggregate_exec.c b/src/aggregate/aggregate_exec.c
index cfdc304..f65235d 100644
--- a/src/aggregate/aggregate_exec.c
+++ b/src/aggregate/aggregate_exec.c
@@ -4,6 +4,10 @@
 #include "aggregate.h"
 #include "cursor.h"
 
+#if defined(__FreeBSD_kernel__)
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif                                                                                  
+
 static void runCursor(RedisModuleCtx *outputCtx, Cursor *cursor, size_t num);
 
 void AggregateCommand_ExecAggregate(RedisModuleCtx *ctx, RedisModuleString **argv, int argc,
diff --git a/src/concurrent_ctx.c b/src/concurrent_ctx.c
index df1f17c..a476574 100644
--- a/src/concurrent_ctx.c
+++ b/src/concurrent_ctx.c
@@ -4,6 +4,10 @@
 #include <util/arr.h>
 #include <assert.h>
 
+#if defined(__FreeBSD_kernel__)
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif                                                                                  
+
 static threadpool *threadpools_g = NULL;
 
 int CONCURRENT_POOL_INDEX = -1;
@@ -232,4 +236,4 @@ void ConcurrentSearchCtx_Unlock(ConcurrentSearchCtx *ctx) {
   ConcurrentSearch_CloseKeys(ctx);
   RedisModule_ThreadSafeContextUnlock(ctx->ctx);
   ctx->isLocked = 0;
-}
\ No newline at end of file
+}
diff --git a/src/query_plan.c b/src/query_plan.c
index 7c7d055..6ab3989 100644
--- a/src/query_plan.c
+++ b/src/query_plan.c
@@ -3,6 +3,10 @@
 #include "value.h"
 #include "aggregate/aggregate.h"
 
+#if defined(__FreeBSD_kernel__)
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif                                                                                  
+
 /******************************************************************************************************
  *   Query Plan - the actual binding context of the whole execution plan - from filters to
  *   processors
