aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2007-03-23 10:08:38 +0000
committerdanielk1977 <danielk1977@noemail.net>2007-03-23 10:08:38 +0000
commita3d4c887e0b4105bc7333060d2d843ea8a056a06 (patch)
treebb7b1a2ec9a13ab5d261f84018e746144831670d /src/os_unix.c
parent8350a2187aa29a5df7c12ecc9cf8f43aa36129ce (diff)
downloadsqlite-a3d4c887e0b4105bc7333060d2d843ea8a056a06.tar.gz
sqlite-a3d4c887e0b4105bc7333060d2d843ea8a056a06.zip
Add a comment to the OsSectorSize() function. (CVS 3710)
FossilOrigin-Name: 0fd9983a98d8d61654f252f1708a4d7232a96b53
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index dfbb9338c..4f722b10d 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2341,6 +2341,20 @@ static int unixLockState(OsFile *id){
}
/*
+** Return the sector size in bytes of the underlying block device for
+** the specified file. This is almost always 512 bytes, but may be
+** larger for some devices.
+**
+** SQLite code assumes this function cannot fail. It also assumes that
+** if two files are created in the same file-system directory (i.e.
+** a database and it's journal file) that the sector size will be the
+** same for both.
+*/
+static int unixSectorSize(OsFile *id){
+ return PAGER_SECTOR_SIZE;
+}
+
+/*
** This vector defines all the methods that can operate on an OsFile
** for unix.
*/
@@ -2359,7 +2373,7 @@ static const IoMethod sqlite3UnixIoMethod = {
unixUnlock,
unixLockState,
unixCheckReservedLock,
- osGenericSectorSize,
+ unixSectorSize,
};
#ifdef SQLITE_ENABLE_LOCKING_STYLE
@@ -2382,7 +2396,7 @@ static const IoMethod sqlite3AFPLockingUnixIoMethod = {
afpUnixUnlock,
unixLockState,
afpUnixCheckReservedLock,
- osGenericSectorSize,
+ unixSectorSize,
};
/*
@@ -2404,7 +2418,7 @@ static const IoMethod sqlite3FlockLockingUnixIoMethod = {
flockUnixUnlock,
unixLockState,
flockUnixCheckReservedLock,
- osGenericSectorSize,
+ unixSectorSize,
};
/*
@@ -2426,7 +2440,7 @@ static const IoMethod sqlite3DotlockLockingUnixIoMethod = {
dotlockUnixUnlock,
unixLockState,
dotlockUnixCheckReservedLock,
- osGenericSectorSize,
+ unixSectorSize,
};
/*
@@ -2448,7 +2462,7 @@ static const IoMethod sqlite3NolockLockingUnixIoMethod = {
nolockUnixUnlock,
unixLockState,
nolockUnixCheckReservedLock,
- osGenericSectorSize,
+ unixSectorSize,
};
#endif /* SQLITE_ENABLE_LOCKING_STYLE */