So this is the scenario that I'm looking at:
I have 3 libraries - A, B and C.
- Library A implements function
foo()
and exposes it as an API. - Function
foo()
calls the POSIXwrite()
call to write some data. - Library B writes a wrapper to the
write()
glibc call using the linker -wrap option. - Library C links to both A and B.
Any write()
call that the library C makes will get intercepted by the wrapper
library B. But, my question is, if library C calls foo()
, will the write()
call inside foo() get intercepted by B?