aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-03-29 18:19:52 +0000
committerdrh <drh@noemail.net>2007-03-29 18:19:52 +0000
commit3ceeb75680d518042aa73f83c0d2875e04f5058d (patch)
tree1515b1aea0b47dd637cb4ceaa924d9e55ba4660d /src
parent2ecad3b4437dab87bdaf5fb2706698b587d35552 (diff)
downloadsqlite-3ceeb75680d518042aa73f83c0d2875e04f5058d.tar.gz
sqlite-3ceeb75680d518042aa73f83c0d2875e04f5058d.zip
Change the name of PAGER_SECTOR_SIZE to SQLITE_DEFAULT_SECTOR_SIZE. Make
the new OS-layer interface routine for finding sector size optional. (CVS 3750) FossilOrigin-Name: 0fb9af1d6e20bf25511c6d2097937cc11137776e
Diffstat (limited to 'src')
-rw-r--r--src/os.c3
-rw-r--r--src/os.h7
-rw-r--r--src/os_os2.c2
-rw-r--r--src/os_unix.c2
-rw-r--r--src/os_win.c2
-rw-r--r--src/pager.c4
6 files changed, 14 insertions, 6 deletions
diff --git a/src/os.c b/src/os.c
index b60831d6a..77f541864 100644
--- a/src/os.c
+++ b/src/os.c
@@ -76,7 +76,8 @@ int sqlite3OsCheckReservedLock(OsFile *id){
return id->pMethod->xCheckReservedLock(id);
}
int sqlite3OsSectorSize(OsFile *id){
- return id->pMethod->xSectorSize(id);
+ int (*xSectorSize)(OsFile*) = id->pMethod->xSectorSize;
+ return xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE;
}
#ifdef SQLITE_ENABLE_REDEF_IO
diff --git a/src/os.h b/src/os.h
index b0afe2f68..af4df325f 100644
--- a/src/os.h
+++ b/src/os.h
@@ -74,6 +74,13 @@
#endif
/*
+** The default size of a disk sector
+*/
+#ifndef SQLITE_DEFAULT_SECTOR_SIZE
+# define SQLITE_DEFAULT_SECTOR_SIZE 512
+#endif
+
+/*
** Temporary files are named starting with this prefix followed by 16 random
** alphanumeric characters, and no file extension. They are stored in the
** OS's standard temporary file directory, and are deleted prior to exit.
diff --git a/src/os_os2.c b/src/os_os2.c
index 1dcf4b672..8c28cccea 100644
--- a/src/os_os2.c
+++ b/src/os_os2.c
@@ -743,7 +743,7 @@ static int os2LockState( OsFile *id ){
** same for both.
*/
static int os2SectorSize(OsFile *id){
- return PAGER_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
diff --git a/src/os_unix.c b/src/os_unix.c
index be3a30a97..fc759d801 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2353,7 +2353,7 @@ static int unixLockState(OsFile *id){
** same for both.
*/
static int unixSectorSize(OsFile *id){
- return PAGER_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
diff --git a/src/os_win.c b/src/os_win.c
index e5cf7ad5c..ddab693e9 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -1466,7 +1466,7 @@ static int winLockState(OsFile *id){
** same for both.
*/
static int winSectorSize(OsFile *id){
- return PAGER_SECTOR_SIZE;
+ return SQLITE_DEFAULT_SECTOR_SIZE;
}
/*
diff --git a/src/pager.c b/src/pager.c
index 032823767..82d7f4ecd 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.305 2007/03/29 17:28:15 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.306 2007/03/29 18:19:52 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -1436,7 +1436,7 @@ end_playback:
}
/* The Pager.sectorSize variable may have been updated while rolling
- ** back a journal created by a process with a different PAGER_SECTOR_SIZE
+ ** back a journal created by a process with a different sector size
** value. Reset it to the correct value for this process.
*/
pPager->sectorSize = sqlite3OsSectorSize(pPager->fd);