aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-03-04 03:20:05 +0000
committerdrh <drh@noemail.net>2016-03-04 03:20:05 +0000
commite808d7c1fe6bf8e261935493a8f22466ef794954 (patch)
tree3762f650bbc1b88e9f1a17f81445710a98f13e1f /src/os_unix.c
parentddebf16f1f209dca695f813c6f87e4ad72c639ec (diff)
parent79a2ca394467bdddb4ac5f607b1d0c54d176bc42 (diff)
downloadsqlite-e808d7c1fe6bf8e261935493a8f22466ef794954.tar.gz
sqlite-e808d7c1fe6bf8e261935493a8f22466ef794954.zip
Detect the presence of pread()/pwrite() system calls on unix systems and
use them if available. FossilOrigin-Name: 82cbf5ad2ed988a006106e188e98096a52e6779d
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index ea07bd99f..d6fbd8058 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -71,6 +71,19 @@
# endif
#endif
+/* Use pread() and pwrite() if they are available */
+#if defined(__APPLE__)
+# define HAVE_PREAD 1
+# define HAVE_PWRITE 1
+#endif
+#if defined(HAVE_PREAD64) && defined(HAVE_PWRITE64)
+# undef USE_PREAD
+# define USE_PREAD64 1
+#elif defined(HAVE_PREAD) && defined(HAVE_PWRITE)
+# undef USE_PREAD64
+# define USE_PREAD 1
+#endif
+
/*
** standard include files.
*/