-C Remove\san\sunused\svariable\sfrom\sthe\stest\slogic.\s(CVS\s5736)
-D 2008-09-23T10:16:05
+C Enable\sthe\sLOCKING_STYLE\sextensions\sby\sdefault\son\sa\sMac.\s\sLeave\sthem\ndisabled\son\sall\sother\sposix\splatforms.\s(CVS\s5737)
+D 2008-09-23T10:23:26
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in e4ab842f9a64ef61d57093539a8aab76b12810db
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c e391fc95adc744bbdcefd4d11e3066998185a0a0
-F src/os_unix.c badd226d71460f0be57f68843ef66a258b0a376c
+F src/os_unix.c ee778087d7b73746598947a93d2e1de3f909c9c2
F src/os_win.c 3209dc0ed734291764393ea8d534ba0d8696a540
F src/pager.c 131746ea47383daf89fce08e0cb09b84cffa39eb
F src/pager.h 1ef5a3f8e0b4c8b30f19c8e01d4fca2db9bb5797
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P a88606245760eaf8054d67773db7d8b795e8ca25
-R 5f4ced03c359d22319ca21d407dd7159
+P 309ba380d985d77419a6e185373493e043823258
+R 2c9572d754434b5bfdf3e25c7b3dbb14
U drh
-Z a47e0f847ded8ccc3b472866b58d53b2
+Z 1990ad5dc1d65a186d212ae883760b71
**
** This file contains code that is specific to Unix systems.
**
-** $Id: os_unix.c,v 1.202 2008/09/22 11:46:33 danielk1977 Exp $
+** $Id: os_unix.c,v 1.203 2008/09/23 10:23:26 drh Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */
/*
-** If SQLITE_ENABLE_LOCKING_STYLE is defined, then several different
-** locking implementations are provided:
+** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
+** alternative locking implementations are provided:
**
** * POSIX locking (the default),
** * No locking,
** * Dot-file locking,
** * flock() locking,
** * AFP locking (OSX only).
-*/
-/* #define SQLITE_ENABLE_LOCKING_STYLE 0 */
+**
+** SQLITE_ENABLE_LOCKING_STYLE only works on a Mac. It is turned on by
+** default on a Mac and disabled on all other posix platforms.
+*/
+#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
+# if defined(__DARWIN__)
+# define SQLITE_ENABLE_LOCKING_STYLE 1
+# else
+# define SQLITE_ENABLE_LOCKING_STYLE 0
+# endif
+#endif
/*
** These #defines should enable >2GB file support on Posix if the
#include <sys/time.h>
#include <errno.h>
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/mount.h>
#endif
struct openCnt *pOpen; /* Info about all open fd's on this inode */
struct lockInfo *pLock; /* Info about locks on this inode */
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
void *lockingContext; /* Locking style specific state */
#endif
int h; /* The file descriptor */
}
}
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
/*
** Tests a byte-range locking query to see if byte range locks are
** supported, if not we fall back to dotlockLockingStyle.
const char *filePath,
int fd
){
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
struct Mapping {
const char *zFilesystem;
int eLockingStyle;
}
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
#pragma mark AFP Support
/*
static sqlite3_io_methods aIoMethod[] = {
IOMETHODS(unixClose, unixLock, unixUnlock, unixCheckReservedLock)
,IOMETHODS(nolockClose, nolockLock, nolockUnlock, nolockCheckReservedLock)
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
,IOMETHODS(dotlockClose, dotlockLock, dotlockUnlock,dotlockCheckReservedLock)
,IOMETHODS(flockClose, flockLock, flockUnlock, flockCheckReservedLock)
,IOMETHODS(afpClose, afpLock, afpUnlock, afpCheckReservedLock)
break;
}
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
case LOCKING_STYLE_AFP: {
/* AFP locking uses the file path so it needs to be included in
** the afpLockingContext.
}
static sqlite3_vfs unixVfs = UNIXVFS("unix", 0);
-#ifdef SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE
int i;
static sqlite3_vfs aVfs[] = {
UNIXVFS("unix-posix", LOCKING_STYLE_POSIX),