Skip to content

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

@luikore

Description

@luikore

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions