http://pubs.opengroup.org/onlinepubs/7908799/xsh/systime.h.html
http://pubs.opengroup.org/onlinepubs/7908799/xsh/flockfile.html http://pubs.opengroup.org/onlinepubs/009695399/functions/fcntl.html // IEEE Std 1003.1, 2004 Edition @!!= linux On Tue, May 13, 2014 at 7:55 AM, Artur Deterer <[email protected]>wrote: > Hello SQLite Developers, > > > > my company would like to use sqlite in our embedded systems for which we > use > a plain C proprietary operating system. > > Memory allocation and deallocation within this system is realized through > standard malloc/free functions. At this point of > > system development we are trying to adapt SQLite to our platform and face > some difficulties: > > > > Before I tell you which errors occur I explain to you the work steps I > walked through. > > 1) As far as I know I have to tell sqlite that it should not > work > on the implemented operating systems but on a > > custom platform and this is to be done setting the macro > SQL_OTHER_OS to 1. (in my code, line 30: SQL_OTHER_OS=1;) > > I did this within the first lines of sqlite3.c file. and at > line 9870 I changed the value of SQL_OTHER_OS to 1 too. > > 2) With our single-threaded task scheduler we also have to tell > sqlite to not allow multithreading operations > > as I did changing the value of SQL_THREADSAFE to 0 in line > 7081. > > 3) On your web pages you wrote that a user has to implement the > functions sqlite3_os_init() and sqlite3_os_end() > > in case that he wants sqlite to run on a custom system but > I > do not know which implementation is needed or whether > > an own implementation is needed because our os memory > operations are based on malloc and free. > > 4) As I read your manual to port SQLite to a new operating > system, I realized that an own implementation of > > sqlite3_vfs is necessary. I took > <http://www.sqlite.org/src/doc/trunk/src/test_demovfs.c> test_demovfs.c as > skeleton for a ownOSVFS implementation. Within our os > > we have an own implementation of FAT32 file system > functions > which I used for substituting the file operation > > functions offered in test_demovfs. > > 5) I set the function sqlite3_initialize() within sqlite3.c in > comments to implement this function within uTaskerVFS.c. > > This file also includes the sqlite3 header file and is > appended to this email. > > > > As I walked through these steps I am not confident whether my > implementation > is correct or misses any point (e.g. sqlite3_os_init()). > > The main reason I write to you is that our cross-compiler (ARM GCC) for an > ARM Cortex M4 system throws compiler errors > > according to sqlite. They tell me that references to several c structures > (e.g. timeval, flock) are missing. These are used within a > > code part that asks whether the current platform is Linux (if macro: line > 23528 ) what obviously is not correct. > > I think that if the macro SQL_OTHER_OS set to 1 the code should not enable > the code part designed for linux os. > > > > Have you an idea of solving the porting difficulties I described in this > email ? > > It would be great ,too, if you could tell me whether I am wrong with my > implementation. > > Can you please give me a more detailed instruction or maybe an example > > integration of sqlite into a custom os? > > > > Kind regards > > Deterer > > > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

