Quoth Roger Binns <rog...@rogerbinns.com>, on 2011-02-28 12:20:04 -0800:
> You could do that in Unix in many years.  I shipped product in 1994 that
> used it extensively (a master daemon would use accept() and then pass the
> new file handles to child processes as appropriate).
> 
> "I_SENDFD" is the magic needed.  The topic is even covered in Stevens.

SCM_RIGHTS is a modern (and, I think, the most usual) way, operating
over a Unix-domain socket.  The header constant, at least, is
specified in POSIX:2001, though I can't find a specification of its
functionality there.  On every Unix I've personally observed have it,
it transmits an array of FDs, which are duplicated into the receiving
process (and the numbers in the message translated accordingly).

http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/socket.h.html

The corresponding call on Windows is DuplicateHandle, which can copy a
handle from one process to another, and is AIUI generally paired with
other IPC to transmit the new handle value.

http://msdn.microsoft.com/en-us/library/bb202788.aspx

Back on the original topic, I would rather think a custom VFS sounds
like the way to go; one should be able to foo_snprintf the underlying
platform-specific handle into an open-string and then get it back out
inside the custom VFS, no?  There can be no incompatibility with the
existing expected uses of the open-string, because those will all be
broken in the use case described anyway.  If it's inconvenient, you
could provide your own chromium_sqlite3_openhandle(handle, ...)
function which would do the conversion and call sqlite3_open behind
the scenes.

   ---> Drake Wilson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to