mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Clean up #ifdef logic dealing with VxWorks in os_unix.c. On VxWorks,
automatically use posix advisory locking if it is available or fall back to named semaphore locking if not. FossilOrigin-Name: ac8c7ca3db14ec19be1f19cfaf14b47fdda0c9ef
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\scompiler\swarnings\swhen\scompiling\sunder\sVxWorks\s7.
|
C Clean\sup\s#ifdef\slogic\sdealing\swith\sVxWorks\sin\sos_unix.c.\s\sOn\sVxWorks,\s\nautomatically\suse\sposix\sadvisory\slocking\sif\sit\sis\savailable\sor\sfall\sback\nto\snamed\ssemaphore\slocking\sif\snot.
|
||||||
D 2015-03-03T19:56:20.675
|
D 2015-03-03T20:42:01.828
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 2f643d6968dfc0b82d2e546a0525a39079f9e928
|
F Makefile.in 2f643d6968dfc0b82d2e546a0525a39079f9e928
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -214,7 +214,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
|
|||||||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||||
F src/os_unix.c 35510fa3a2f38b076a9628557c1ead63bbb49cdc
|
F src/os_unix.c 49d06acee4053920e4a6429844f440b5f975cea4
|
||||||
F src/os_win.c 8223e7db5b7c4a81d8b161098ac3959400434cdb
|
F src/os_win.c 8223e7db5b7c4a81d8b161098ac3959400434cdb
|
||||||
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
|
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
|
||||||
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
|
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
|
||||||
@@ -1240,7 +1240,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P 39b566a2d0916c57f3fac756c6d6af149b44781d
|
P 55c21521a64703d7050c7f8975538f4cfae95eb7
|
||||||
R 9a933a4520ccec36872b9bf9ae4c7dcf
|
R 32d4311730abf3951dfa00f9351fabd2
|
||||||
U drh
|
U drh
|
||||||
Z d802fbee836547f901f82efaa92d78f9
|
Z e82a4097b0bf48a2167ca03dbf90a10e
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
55c21521a64703d7050c7f8975538f4cfae95eb7
|
ac8c7ca3db14ec19be1f19cfaf14b47fdda0c9ef
|
||||||
@@ -85,18 +85,19 @@
|
|||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
|
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
# if OS_VXWORKS
|
# include <sys/file.h>
|
||||||
# include <semaphore.h>
|
# include <sys/param.h>
|
||||||
# include <limits.h>
|
|
||||||
# else
|
|
||||||
# include <sys/file.h>
|
|
||||||
# include <sys/param.h>
|
|
||||||
# endif
|
|
||||||
#endif /* SQLITE_ENABLE_LOCKING_STYLE */
|
#endif /* SQLITE_ENABLE_LOCKING_STYLE */
|
||||||
|
|
||||||
#if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
#if OS_VXWORKS
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
# include <semaphore.h>
|
||||||
|
# include <limits.h>
|
||||||
|
#endif /* OS_VXWORKS */
|
||||||
|
|
||||||
|
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
|
||||||
# include <sys/mount.h>
|
# include <sys/mount.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -377,7 +378,7 @@ static struct unix_syscall {
|
|||||||
{ "read", (sqlite3_syscall_ptr)read, 0 },
|
{ "read", (sqlite3_syscall_ptr)read, 0 },
|
||||||
#define osRead ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)
|
#define osRead ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)
|
||||||
|
|
||||||
#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
|
||||||
{ "pread", (sqlite3_syscall_ptr)pread, 0 },
|
{ "pread", (sqlite3_syscall_ptr)pread, 0 },
|
||||||
#else
|
#else
|
||||||
{ "pread", (sqlite3_syscall_ptr)0, 0 },
|
{ "pread", (sqlite3_syscall_ptr)0, 0 },
|
||||||
@@ -394,7 +395,7 @@ static struct unix_syscall {
|
|||||||
{ "write", (sqlite3_syscall_ptr)write, 0 },
|
{ "write", (sqlite3_syscall_ptr)write, 0 },
|
||||||
#define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent)
|
#define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent)
|
||||||
|
|
||||||
#if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
|
#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
|
||||||
{ "pwrite", (sqlite3_syscall_ptr)pwrite, 0 },
|
{ "pwrite", (sqlite3_syscall_ptr)pwrite, 0 },
|
||||||
#else
|
#else
|
||||||
{ "pwrite", (sqlite3_syscall_ptr)0, 0 },
|
{ "pwrite", (sqlite3_syscall_ptr)0, 0 },
|
||||||
@@ -2232,10 +2233,9 @@ static int dotlockClose(sqlite3_file *id) {
|
|||||||
** still works when you do this, but concurrency is reduced since
|
** still works when you do this, but concurrency is reduced since
|
||||||
** only a single process can be reading the database at a time.
|
** only a single process can be reading the database at a time.
|
||||||
**
|
**
|
||||||
** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off or if
|
** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
|
||||||
** compiling for VXWORKS.
|
|
||||||
*/
|
*/
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
|
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Retry flock() calls that fail with EINTR
|
** Retry flock() calls that fail with EINTR
|
||||||
@@ -5029,7 +5029,7 @@ IOMETHODS(
|
|||||||
0 /* xShmMap method */
|
0 /* xShmMap method */
|
||||||
)
|
)
|
||||||
|
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
|
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||||
IOMETHODS(
|
IOMETHODS(
|
||||||
flockIoFinder, /* Finder function name */
|
flockIoFinder, /* Finder function name */
|
||||||
flockIoMethods, /* sqlite3_io_methods object name */
|
flockIoMethods, /* sqlite3_io_methods object name */
|
||||||
@@ -5174,15 +5174,13 @@ static const sqlite3_io_methods
|
|||||||
|
|
||||||
#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */
|
#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */
|
||||||
|
|
||||||
#if OS_VXWORKS && SQLITE_ENABLE_LOCKING_STYLE
|
#if OS_VXWORKS
|
||||||
/*
|
/*
|
||||||
** This "finder" function attempts to determine the best locking strategy
|
** This "finder" function for VxWorks checks to see if posix advisory
|
||||||
** for the database file "filePath". It then returns the sqlite3_io_methods
|
** locking works. If it does, then that is what is used. If it does not
|
||||||
** object that implements that strategy.
|
** work, then fallback to named semaphore locking.
|
||||||
**
|
|
||||||
** This is for VXWorks only.
|
|
||||||
*/
|
*/
|
||||||
static const sqlite3_io_methods *autolockIoFinderImpl(
|
static const sqlite3_io_methods *vxworksIoFinderImpl(
|
||||||
const char *filePath, /* name of the database file */
|
const char *filePath, /* name of the database file */
|
||||||
unixFile *pNew /* the open file object */
|
unixFile *pNew /* the open file object */
|
||||||
){
|
){
|
||||||
@@ -5208,9 +5206,9 @@ static const sqlite3_io_methods *autolockIoFinderImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
static const sqlite3_io_methods
|
static const sqlite3_io_methods
|
||||||
*(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl;
|
*(*const vxworksIoFinder)(const char*,unixFile*) = vxworksIoFinderImpl;
|
||||||
|
|
||||||
#endif /* OS_VXWORKS && SQLITE_ENABLE_LOCKING_STYLE */
|
#endif /* OS_VXWORKS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** An abstract type for a pointer to an IO method finder function:
|
** An abstract type for a pointer to an IO method finder function:
|
||||||
@@ -7493,8 +7491,10 @@ int sqlite3_os_init(void){
|
|||||||
** array cannot be const.
|
** array cannot be const.
|
||||||
*/
|
*/
|
||||||
static sqlite3_vfs aVfs[] = {
|
static sqlite3_vfs aVfs[] = {
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
|
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
|
||||||
UNIXVFS("unix", autolockIoFinder ),
|
UNIXVFS("unix", autolockIoFinder ),
|
||||||
|
#elif OS_VXWORKS
|
||||||
|
UNIXVFS("unix", vxworksIoFinder ),
|
||||||
#else
|
#else
|
||||||
UNIXVFS("unix", posixIoFinder ),
|
UNIXVFS("unix", posixIoFinder ),
|
||||||
#endif
|
#endif
|
||||||
@@ -7504,11 +7504,11 @@ int sqlite3_os_init(void){
|
|||||||
#if OS_VXWORKS
|
#if OS_VXWORKS
|
||||||
UNIXVFS("unix-namedsem", semIoFinder ),
|
UNIXVFS("unix-namedsem", semIoFinder ),
|
||||||
#endif
|
#endif
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
|
||||||
UNIXVFS("unix-posix", posixIoFinder ),
|
UNIXVFS("unix-posix", posixIoFinder ),
|
||||||
#if !OS_VXWORKS
|
|
||||||
UNIXVFS("unix-flock", flockIoFinder ),
|
|
||||||
#endif
|
#endif
|
||||||
|
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||||
|
UNIXVFS("unix-flock", flockIoFinder ),
|
||||||
#endif
|
#endif
|
||||||
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
|
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
|
||||||
UNIXVFS("unix-afp", afpIoFinder ),
|
UNIXVFS("unix-afp", afpIoFinder ),
|
||||||
|
|||||||
Reference in New Issue
Block a user