-C Initial\sattempt\sto\sget\sSQLite\sworking\swith\sOFD\slocks\son\sLinux.\sThe\scode\shere\ndoes\snot\sfunction\scorrectly.\sThis\sis\san\sincremental\scheck-in\sfor\sa\swork\sin\nprogress.
-D 2018-06-19T13:45:48.548
+C Miscellaneous\scleanup\sof\sOFD\slogic.\s\sAdd\san\s#if\s0\sto\sdisable\sthe\suse\sof\nOFD\slogic,\stemporarily,\suntil\sI\scan\sget\sit\sto\sactually\swork.
+D 2018-06-19T17:19:46.493
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in bfc40f350586923e0419d2ea4b559c37ec10ee4b6e210e08c14401f8e340f0da
F src/os.h 48388821692e87da174ea198bf96b1b2d9d83be5dfc908f673ee21fafbe0d432
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
-F src/os_unix.c da3e1802d4c8946d76350a5f58347ae6c25a1ff028b059bc3060efa7e90a969e
+F src/os_unix.c 71b17c32fce222f7dfd94dd62871dff3e645e5cd4a84d45b400469cbb39bba9f
F src/os_win.c ac29c25cde4cfb4adacc59cdec4aa45698ca0e29164ea127859585ccd9faa354
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 1bb6a57fa0465296a4d6109a1a64610a0e7adde1f3acf3ef539a9d972908ce8f
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 320fa69e6aa2a7d67f6444d6c13de9893e27b85c36a933b06da113d753b6aafc
-R c7d7dcd11c67967d0f404fe07c1adca6
-T *branch * ofd-locks
-T *sym-ofd-locks *
-T -sym-trunk *
+P 148f8dec9a26f11d343bfeb558fd12ba18d7f5d4d69da58fc8aa22f88e13c408
+R 83961ea01a7dee6aa8cd5a190f64b60a
U drh
-Z d5c78e27187e28437ed1607871e9e53d
+Z 043ea47a258168f0e14367c4e0b60a6e
-148f8dec9a26f11d343bfeb558fd12ba18d7f5d4d69da58fc8aa22f88e13c408
\ No newline at end of file
+d849ade396d2dda4ed18f8e44d19ab218f94ef41a76a99f937238253e716dc05
\ No newline at end of file
*/
#if defined(F_OFD_SETLK) && defined(F_OFD_GETLK)
# define HAVE_OFD_LOCKS 1
+# define UsesOfd(F) ((F)->eGetLk==F_OFD_GETLK)
+# define UsesOldStylePosixLocks(F) ((F)->eGetLk==F_GETLK)
#else
# define HAVE_OFD_LOCKS 0
+# define UsesOfd(F) 0
+# define UsesOldStylePosixLocks(F) 1
# define F_OFD_SETLK 0 /* Fake value so we can use the identifier */
# define F_OFD_GETLK 0 /* Fake value so we can use the identifier */
#endif
zOpName = "GETLK";
}else if( op==F_SETLK || op==F_OFD_SETLK ){
zOpName = "SETLK";
+#if HAVE_OFD_LOCKS
+ }else if( op==F_OFD_GETLK ){
+ zOpName = "OFD_GETLK";
+ }else if( op==F_OFD_SETLK ){
+ zOpName = "OFD_SETLK";
+#endif
}else{
s = osFcntl(fd, op, p);
sqlite3DebugPrintf("fcntl unknown %d %d %d\n", fd, op, s);
){
struct flock l2;
l2 = *p;
- osFcntl(fd, F_GETLK, &l2);
+ osFcntl(fd, op==F_SETLK ? F_GETLK : F_OFD_GETLK, &l2);
if( l2.l_type==F_RDLCK ){
zType = "RDLCK";
}else if( l2.l_type==F_WRLCK ){
** return SQLITE_OK.
*/
if( eFileLock==SHARED_LOCK
- && pFile->eGetLk==F_GETLK
+ && UsesOldStylePosixLocks(pFile)
&& (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK)
){
assert( eFileLock==SHARED_LOCK );
goto end_lock;
}
-
/* A PENDING lock is needed before acquiring a SHARED lock and before
** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will
** be released.
pNew->h = h;
pNew->eSetLk = F_SETLK;
pNew->eGetLk = F_GETLK;
-#if HAVE_OFD_LOCKS
+#if HAVE_OFD_LOCKS && 0
{
struct flock lock;
lock.l_whence = SEEK_SET;