nyara icon indicating copy to clipboard operation
nyara copied to clipboard

Find a way to override read(2) / write(2) / send(2)

Open luikore opened this issue 11 years ago • 0 comments

Override kernel IO functions before loading database drivers, then we can make everything even C-ext based database drivers async. But these read/write/send need to be separated from the usage in nyara's ext.

Then drivers of mongo, pg and mysql can be made totally async easily.

For concurrency safety, we still need to consider their C-side thread-local storages.

stubbing

To stub system calls in linux, use LD_PRELOAD, example

LD_PRELOAD=/my/malloc.so ls

It could be ignored if rid (real user) != eid (effective user), ref: http://www.lst.de/~okir/blackhats/node23.html

The OSX equivalent is DYLD_INSERT_LIBRARIES (not quite equivalent in fact) https://blogs.oracle.com/DatabaseEmporium/entry/where_is_ld_preload_under

luikore avatar Jul 14 '13 07:07 luikore