*** 49,197 **** +#endif + /* ! ** Macros for performance tracing. Normally turned off ! */ ! @@ -232,9 +236,9 @@ ! int *pReadonly ! ){ ! #if OS_UNIX ! - id->fd = open(zFilename, O_RDWR|O_CREAT, 0644); ! + id->fd = open(zFilename, O_RDWR|O_CREAT|O_BINARY, 0644); ! if( id->fd<0 ){ ! - id->fd = open(zFilename, O_RDONLY); ! + id->fd = open(zFilename, O_RDONLY|O_BINARY); ! if( id->fd<0 ){ ! return SQLITE_CANTOPEN; ! } ! @@ -306,7 +310,7 @@ ! #ifndef O_NOFOLLOW ! # define O_NOFOLLOW 0 ! #endif ! - id->fd = open(zFilename, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0600); ! + id->fd = open(zFilename, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_BINARY, 0600); ! if( id->fd<0 ){ ! return SQLITE_CANTOPEN; ! } ! @@ -359,7 +363,7 @@ ! */ ! int sqliteOsOpenReadOnly(const char *zFilename, OsFile *id){ ! #if OS_UNIX ! - id->fd = open(zFilename, O_RDONLY); ! + id->fd = open(zFilename, O_RDONLY|O_BINARY); ! if( id->fd<0 ){ ! return SQLITE_CANTOPEN; ! } ! @@ -682,9 +686,13 @@ ! lock.l_type = F_RDLCK; ! lock.l_whence = SEEK_SET; ! lock.l_start = lock.l_len = 0L; ! +#ifdef __DJGPP__ ! + { ! +#else ! if( fcntl(id->fd, F_SETLK, &lock)!=0 ){ ! rc = SQLITE_BUSY; ! }else{ ! +#endif ! rc = SQLITE_OK; ! id->pLock->cnt = 1; ! id->locked = 1; ! @@ -736,9 +744,13 @@ ! lock.l_type = F_WRLCK; ! lock.l_whence = SEEK_SET; ! lock.l_start = lock.l_len = 0L; ! +#ifdef __DJGPP__ ! + { ! +#else ! if( fcntl(id->fd, F_SETLK, &lock)!=0 ){ ! rc = SQLITE_BUSY; ! }else{ ! +#endif ! rc = SQLITE_OK; ! id->pLock->cnt = -1; ! id->locked = 1; ! @@ -798,9 +810,13 @@ ! lock.l_type = F_UNLCK; ! lock.l_whence = SEEK_SET; ! lock.l_start = lock.l_len = 0L; ! +#ifdef __DJGPP__ ! + { ! +#else ! if( fcntl(id->fd, F_SETLK, &lock)!=0 ){ ! rc = SQLITE_BUSY; ! }else{ ! +#endif ! rc = SQLITE_OK; ! id->pLock->cnt = 0; ! } ! ! This is needed, because files need to be explicitely opened in binary mode and the check for locking always fails in DJGPP. ! ! DJGPP: http://www.delorie.com/djgpp ! ! ==== ! ! *Microsoft Visual Studio.NET* ! ! See HowToCompileWithVsNet. ! ! ==== ! ! *MSVC and SQLite DLL* ! ! Creation of an import library from the sqlitedll.zip ! (http://www.sqlite.org/sqlitedll.zip) for MS Visual C++ ! is achieved by the following command: ! ! LIB /DEF:sqlite.def ! ! This makes the files sqlite.lib and sqlite.exp files. ! The sqlite.lib can then be used to link your programs ! against the SQLite DLL. ! ! ! ! ===== ! ! *Crosscompile linux x86 -> linux arm* ! ! 1. Install skiff toolchain or similar, make shure you have arm-linux-gcc in your PATH. ! ! 2. Unpack sqlite sources and create a directory _sqlite-arm_ in the same dir. ! ! 3. Edit _configure_ script in the sqlite dir and comment following lines out as shown - have fun finding them ;-) ! ! if test "$cross_compiling" = "yes"; then ! { { echo "$as_me:12710: error: unable to find a compiler for building build tools" >&5 ! echo "$as_me: error: unable to find a compiler for building build tools" >&2;} ! { (exit 1); exit 1; }; } ! fi ! ! . . . ! ! else ! test "$cross_compiling" = yes && ! { { echo "$as_me:13264: error: cannot check for file existence when cross compiling" >&5 ! echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ! { (exit 1); exit 1; }; } ! ! . . . ! ! else ! test "$cross_compiling" = yes && ! { { echo "$as_me:13464: error: cannot check for file existence when cross compiling" >&5 ! echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ! { (exit 1); exit 1; }; } ! ! . . . ! ! else ! test "$cross_compiling" = yes && ! { { echo "$as_me:13490: error: cannot check for file existence when cross compiling" >&5 ! echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} ! { (exit 1); exit 1; }; } ! ! ! 4. Save the configure script, change into the build directory you created and call the edited configure script from the sqlite directorterface adding patch-sets, bug tracking, and Wiki to CVS. http://www.hwaci.com/sw/cvstrac/. *: SQL Relay: A persistent database connection pooling, proxying and load --- 49,55 ---- +#endif + /* ! ** Macros fterface adding patch-sets, bug tracking, and Wiki to CVS. http://www.hwaci.com/sw/cvstrac/. *: SQL Relay: A persistent database connection pooling, proxying and load