diff options
author | Bill King <bill.king@nokia.com> | 2009-10-21 04:14:18 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-10-21 05:02:07 (GMT) |
commit | 84cf05349fa3e106a498dc479f44bbd0cc402f2a (patch) | |
tree | 37f4cda93265bb313fc47ce8e8785202cd93e662 /src | |
parent | 0d61cf15358e1ff0b5125542ed4a9c4b7e96c141 (diff) | |
download | Qt-84cf05349fa3e106a498dc479f44bbd0cc402f2a.zip Qt-84cf05349fa3e106a498dc479f44bbd0cc402f2a.tar.gz Qt-84cf05349fa3e106a498dc479f44bbd0cc402f2a.tar.bz2 |
VXWorks changes.
Forward port the vxworks changes from d7b688870aead912690188b324d370b920a7a600
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/sqlite/sqlite3.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c index 90a64ba..46d3dfc 100644 --- a/src/3rdparty/sqlite/sqlite3.c +++ b/src/3rdparty/sqlite/sqlite3.c @@ -420,7 +420,7 @@ ** ** See also ticket #2741. */ -#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE +#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE && !defined(VXWORKS) # define _XOPEN_SOURCE 500 /* Needed to enable pthread recursive mutexes */ #endif @@ -564,6 +564,13 @@ SQLITE_PRIVATE void sqlite3Coverage(int); */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ + +#ifdef VXWORKS +# define SQLITE_HOMEGROWN_RECURSIVE_MUTEX +# define NO_GETTOD +# include <ioLib.h> +#endif + #include <stdarg.h> /* Needed for the definition of va_list */ /* @@ -21470,7 +21477,11 @@ SQLITE_API int sqlite3_os_end(void){ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> -#include <sys/time.h> +#ifdef VXWORKS +# include <sys/times.h> +#else +# include <sys/time.h> +#endif #include <errno.h> #if SQLITE_ENABLE_LOCKING_STYLE @@ -24411,7 +24422,11 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ } return -1; } - got = write(id->h, pBuf, cnt); +# ifndef VXWORKS + got = write(id->h, pBuf, cnt); +# else + got = write(id->h, (char *)pBuf, cnt); +# endif #endif TIMER_END; if( got<0 ){ @@ -25808,12 +25823,16 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ #if !defined(SQLITE_TEST) { int pid, fd; - fd = open("/dev/urandom", O_RDONLY); + fd = open("/dev/urandom", O_RDONLY, 0); if( fd<0 ){ time_t t; time(&t); memcpy(zBuf, &t, sizeof(t)); - pid = getpid(); +#ifndef VXWORKS + pid = getpid(); +#else + pid = (int)taskIdCurrent(); +#endif memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid)); assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf ); nBuf = sizeof(t) + sizeof(pid); |