On Fri, Aug 27, 2010 at 04:58, Richard Hipp <d...@sqlite.org> wrote:

> The VFS interface is published, stable, and documented.  I think the VFS is
> the interface you should be using.
>
> You do not have to patch os_unix.c.  Leave it unchanged.


Sounds good to me. This is one of my goals - to avoid those custom patches,
or send them upstream.


> Instead, create your own os_chromium.c based off of your patched os_unix.c
> (changing just a
> few identifiers to avoid conflicts) and link it with your process as a
> separate file.


I think this is the non-trivial step. Those chromium_sqlite3 functions use
some symbols that are declared static in os_unix.c, so they're not available
outside of it. That means we would have to copy a lot of os_unix.c file's
contents, and I'd prefer to avoid that.


> (You really should be using the SQLite amalgamation file
> sqlite3.c - not separate source files - since the amalgamation runs about
> 5%
> or 10% faster due to better compiler optimizations.)


At least currently Chromium isn't going to use the amalgamation because we
have a lot of custom patches. I'm trying to clean up this situation though.


> At start-time, simply call sqlite3_vfs_register() to register your
> customized VFS with SQLite.
>

That's what our implementation effectively does, see
http://trac.webkit.org/browser/trunk/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
 .

Would it be possible to add a variant of the unix vfs inside of os_unix.c?
I'm still not sure if the current VFS interface would be sufficient for
that. It seems that the most needed exposed call is ability to transform a
file path into a file descriptor
(chromium_sqlite3_get_reusable_file_handle).
chromium_sqlite3_get_reusable_file_handle
currently needs access to things like unixFile, findReusableFd,
UnixUnusedFd, and sqlite3_malloc. Would you have any suggestions how to fit
that into the SQLite's VFS implementation?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to