aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2014-06-23 10:04:58 +0000
committerdan <dan@noemail.net>2014-06-23 10:04:58 +0000
commit702eec1cea5977e7bafab00045b391533d462717 (patch)
tree4962a3791d4f6358ab419f3e7353e53093d41e30 /src/os_unix.c
parent56e67dd7c7554f3e410dc172b6b1827aea68a820 (diff)
downloadsqlite-702eec1cea5977e7bafab00045b391533d462717.tar.gz
sqlite-702eec1cea5977e7bafab00045b391533d462717.zip
Fix a problem with SQLITE_OMIT_WAL builds.
FossilOrigin-Name: 612b6d1b1f74eaf618520b90811eca10f978fc71
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 7eb25c85f..347e82220 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -445,11 +445,11 @@ static struct unix_syscall {
{ "mremap", (sqlite3_syscall_ptr)0, 0 },
#endif
#define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent)
-#endif
-
{ "getpagesize", (sqlite3_syscall_ptr)unixGetpagesize, 0 },
#define osGetpagesize ((int(*)(void))aSyscall[24].pCurrent)
+#endif
+
}; /* End of the overrideable system calls */
/*
@@ -3964,8 +3964,25 @@ static int unixDeviceCharacteristics(sqlite3_file *id){
return rc;
}
-#ifndef SQLITE_OMIT_WAL
+#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0
+
+/*
+** Return the system page size.
+**
+** This function should not be called directly by other code in this file.
+** Instead, it should be called via macro osGetpagesize().
+*/
+static int unixGetpagesize(void){
+#if defined(_BSD_SOURCE)
+ return getpagesize();
+#else
+ return (int)sysconf(_SC_PAGESIZE);
+#endif
+}
+#endif /* !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 */
+
+#ifndef SQLITE_OMIT_WAL
/*
** Object used to represent an shared memory buffer.
@@ -4117,20 +4134,6 @@ static int unixShmSystemLock(
}
/*
-** Return the system page size.
-**
-** This function should not be called directly by other code in this file.
-** Instead, it should be called via macro osGetpagesize().
-*/
-static int unixGetpagesize(void){
-#if defined(_BSD_SOURCE)
- return getpagesize();
-#else
- return (int)sysconf(_SC_PAGESIZE);
-#endif
-}
-
-/*
** Return the minimum number of 32KB shm regions that should be mapped at
** a time, assuming that each mapping must be an integer multiple of the
** current system page-size.