aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2005-01-19 23:24:50 +0000
committerdrh <drh@noemail.net>2005-01-19 23:24:50 +0000
commit1398ad3639594cb7ea85de610385fc0cd2e433b0 (patch)
treeeb90f3020118284c04a898cb77cfe6cc01340ed8 /src/os_unix.c
parent76b047d957abf185953da5ea7489a9ebc15957b2 (diff)
downloadsqlite-1398ad3639594cb7ea85de610385fc0cd2e433b0.tar.gz
sqlite-1398ad3639594cb7ea85de610385fc0cd2e433b0.zip
Continued refactoring of the name resolution logic and query optimizer. (CVS 2236)
FossilOrigin-Name: d8b2a7e09187564fe66a2b4bf0992c6a017146cf
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 3797a82cb..bc5c0b111 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -691,8 +691,17 @@ int sqlite3OsSeek(OsFile *id, i64 offset){
** The fsync() system call does not work as advertised on many
** unix systems. The following procedure is an attempt to make
** it work better.
+**
+** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful
+** for testing when we want to run through the test suite quickly.
+** You are strongly advised *not* to deploy with SQLITE_NO_SYNC
+** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
+** or power failure will likely corrupt the database file.
*/
static int full_fsync(int fd){
+#ifdef SQLITE_NO_SYNC
+ return SQLITE_OK;
+#else
int rc;
#ifdef F_FULLFSYNC
rc = fcntl(fd, F_FULLFSYNC, 0);
@@ -701,6 +710,7 @@ static int full_fsync(int fd){
rc = fsync(fd);
#endif
return rc;
+#endif
}
/*