summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-04-01 16:51:41 -0400
committerKeith Bostic <keith.bostic@mongodb.com>2016-04-01 16:51:41 -0400
commit3ac50db225cbb0314f72f9933e5ea43179f7a553 (patch)
treec71064a9143f56e572c2007ecf248c853d34b095
parent4810db116772f6173f746d1439811d67bd304c6b (diff)
parentf81a2adf42dc1e3e8215850a791e69133e0aeea7 (diff)
downloadmongo-3ac50db225cbb0314f72f9933e5ea43179f7a553.tar.gz
Merge pull request #2625 from wiredtiger/POSIX_FADVISE
WT-2527: OS X compile error, missing POSIX_FADV_WILLNEED #define
-rw-r--r--src/include/msvc.h11
-rw-r--r--src/include/os.h12
2 files changed, 12 insertions, 11 deletions
diff --git a/src/include/msvc.h b/src/include/msvc.h
index 222c24c3bc6..d5be5bd8c60 100644
--- a/src/include/msvc.h
+++ b/src/include/msvc.h
@@ -17,17 +17,6 @@
#define WT_SIZET_FMT "Iu" /* size_t format string */
/*
- * The Windows fadvise calls will return ENOTSUP, but the WiredTiger code
- * currently uses POSIX flags in the API.
- */
-#ifndef POSIX_FADV_DONTNEED
-#define POSIX_FADV_DONTNEED 0
-#endif
-#ifndef POSIX_FADV_WILLNEED
-#define POSIX_FADV_WILLNEED 0
-#endif
-
-/*
* Add MSVC-specific attributes and pragmas to types and function declarations.
*/
#define WT_COMPILER_TYPE_ALIGN(x) __declspec(align(x))
diff --git a/src/include/os.h b/src/include/os.h
index 5034b17511d..af550b218b8 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -58,6 +58,18 @@
(t1).tv_nsec < (t2).tv_nsec ? -1 : \
(t1).tv_nsec == (t2).tv_nsec ? 0 : 1 : 1)
+/*
+ * The underlying OS calls return ENOTSUP if posix_fadvise functionality isn't
+ * available, but the WiredTiger code uses the the POSIX flag names in the API.
+ * Use two values so the underlying code can distinguish.
+ */
+#ifndef POSIX_FADV_DONTNEED
+#define POSIX_FADV_DONTNEED 0x01
+#endif
+#ifndef POSIX_FADV_WILLNEED
+#define POSIX_FADV_WILLNEED 0x02
+#endif
+
#define WT_OPEN_CREATE 0x001 /* Create is OK */
#define WT_OPEN_EXCLUSIVE 0x002 /* Exclusive open */
#define WT_OPEN_FIXED 0x004 /* Path isn't relative to home */