We have a custom library shim that we are using to intercept libc calls
from applications. We are loading this shim beneath nginx 1.2.3 using
the LD_PRELOAD flag on both Linux and FreeBSD environments.
After setting env LD_PRELOAD in the nginx.conf file, our shim is able to
intercept a host of libc calls including read and write (as expected).
On FreeBSD, sendfile is also intercepted from nginx as expected by our
On Linux however, our library is never reached when calling sendfile,
even though we have verified that sendfile is being included from
sys/sendfile.h (both through checking the bindings of the calls
themselves using debugging tools and through tracing the code inside
Calling sendfile through other applications results in a successful
redirection to our library.
I’m wondering if anyone has encountered difficulty with intercepting
sendfile from nginx on Linux before, or if this is possibly an oversight
on our part.
Thanks in advance for any insight,