1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Changes that will perhaps enable SQLite to work better on VxWorks.

FossilOrigin-Name: de27c742c0dcda20b51339598bf6094a8dcf5fb9
This commit is contained in:
drh
2014-08-11 13:53:30 +00:00
parent e8a537eea7
commit 91be7dc320
3 changed files with 19 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
C Update\srequirements\smarks.\s\sNo\schanges\sto\scode. C Changes\sthat\swill\sperhaps\senable\sSQLite\sto\swork\sbetter\son\sVxWorks.
D 2014-08-08T18:26:20.575 D 2014-08-11T13:53:30.969
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -207,7 +207,7 @@ F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace
F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e F src/os.h 60d419395e32a8029fa380a80a3da2e9030f635e
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 f0a58d439d58b207c06f4a25463113dcba7bd9da F src/os_unix.c 17e7ab0f9160a78c964d615b15b1658ab2090d42
F src/os_win.c 3fca1bfdf78338705bf536059a407d0fb04016d5 F src/os_win.c 3fca1bfdf78338705bf536059a407d0fb04016d5
F src/os_win.h 057344a6720b4c8405d9bd98f58cb37a6ee46c25 F src/os_win.h 057344a6720b4c8405d9bd98f58cb37a6ee46c25
F src/pager.c f6bb1fa6cdf2062f2d8aec3e64db302bca519ab8 F src/pager.c f6bb1fa6cdf2062f2d8aec3e64db302bca519ab8
@@ -1185,7 +1185,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 bdaa6947371a60a31b6a13267b0ba6e46df2a8ce P 7556bd9aa5db1b9cd92d0e48effcda9fe96f3128
R 72bdb7fa5001d300e89054929fd995d2 R 07fe7ef4c70cea44dc683244e34b47a2
U drh U drh
Z 671dba8d2ee0bfa11f311df8108f5873 Z c5b6316215c9354c3470fdb843673338

View File

@@ -1 +1 @@
7556bd9aa5db1b9cd92d0e48effcda9fe96f3128 de27c742c0dcda20b51339598bf6094a8dcf5fb9

View File

@@ -97,8 +97,7 @@
# 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 # if OS_VXWORKS
# include <semaphore.h> # include <semaphore.h>
@@ -318,7 +317,11 @@ static int posixOpen(const char *zFile, int flags, int mode){
** we are not running as root. ** we are not running as root.
*/ */
static int posixFchown(int fd, uid_t uid, gid_t gid){ static int posixFchown(int fd, uid_t uid, gid_t gid){
#if OS_VXWORKS
return 0;
#else
return geteuid() ? 0 : fchown(fd,uid,gid); return geteuid() ? 0 : fchown(fd,uid,gid);
#endif
} }
/* Forward reference */ /* Forward reference */
@@ -374,7 +377,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 #if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
{ "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 },
@@ -391,7 +394,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 #if defined(USE_PREAD) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS)
{ "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 },
@@ -1295,7 +1298,11 @@ static int findInodeInfo(
static int fileHasMoved(unixFile *pFile){ static int fileHasMoved(unixFile *pFile){
struct stat buf; struct stat buf;
return pFile->pInode!=0 && return pFile->pInode!=0 &&
#if OS_VXWORKS
pFile->pId!=pFile->pInode->fileId.Pid;
#else
(osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino); (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
#endif
} }
@@ -2438,7 +2445,6 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
/* Otherwise see if some other process holds it. */ /* Otherwise see if some other process holds it. */
if( !reserved ){ if( !reserved ){
sem_t *pSem = pFile->pInode->pSem; sem_t *pSem = pFile->pInode->pSem;
struct stat statBuf;
if( sem_trywait(pSem)==-1 ){ if( sem_trywait(pSem)==-1 ){
int tErrno = errno; int tErrno = errno;
@@ -2491,7 +2497,6 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
*/ */
static int semLock(sqlite3_file *id, int eFileLock) { static int semLock(sqlite3_file *id, int eFileLock) {
unixFile *pFile = (unixFile*)id; unixFile *pFile = (unixFile*)id;
int fd;
sem_t *pSem = pFile->pInode->pSem; sem_t *pSem = pFile->pInode->pSem;
int rc = SQLITE_OK; int rc = SQLITE_OK;