Hi all,
I am writing a shared library to intercept calls to open() (partly inspired by how tsocks works). What I want to do is redirect tho open() to a different file (depending on the input pathname). So, I intend to intercept it, change pathname as required and then call the real open().
I tried doing this, but since I define open(), I can't call the real open(). To avoid this, I thought of using dlopen(). Please see the (very short) code I've written to do this.
http://pastie.org/826380
It gives the following error
'Inconsistency detected by ld.so: dl-open.c: 643: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!'
Can you suggest a fix or an alternate way of doing this?
Thanks in advance!
auli