crazyg33k
crazyg33k

Reputation: 165

Linking to multiple libraries, one of which wraps a set of system calls

So this is the scenario that I'm looking at:

I have 3 libraries - A, B and C.

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?

Upvotes: 6

Views: 208

Answers (1)

n. m. could be an AI
n. m. could be an AI

Reputation: 119877

If A is linked with -wrap=write, foo will call the wrapper. If it's not, it won't.

The same is true about calls to write in C. There's no difference whatsoever between A and C as far as calling write is concerned.

Upvotes: 2

Related Questions