aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2012-11-13 11:08:49 +0000
committerdrh <drh@noemail.net>2012-11-13 11:08:49 +0000
commit6033e15aa25012e67e94054fb844f0acef1b69c7 (patch)
tree7c1d747b42b669db20d610ce8986385d4871564f /src/os_unix.c
parent0fbb50ee153e654b24c44612056442b377b4763a (diff)
downloadsqlite-6033e15aa25012e67e94054fb844f0acef1b69c7.tar.gz
sqlite-6033e15aa25012e67e94054fb844f0acef1b69c7.zip
Use preprocessor macros to automatically detect whether or not
posix_allocate() is available. (It is generally available on Linux but not on Mac.) Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3] FossilOrigin-Name: 597333f1024092b94bcd8772541e19a0f707bd40
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 21ec0fda9..a3a012126 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -46,6 +46,13 @@
#include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */
+/* Use posix_fallocate() if it is available
+*/
+#if !defined(HAVE_POSIX_FALLOCATE) \
+ && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L)
+# define HAVE_POSIX_FALLOCATE 1
+#endif
+
/*
** There are various methods for file locking used for concurrency
** control: