I have written wrappers for both open() and open64(). Now I run vi by preloading my wrapper library using LD_PRELOAD environment variable and I see that the open64() wrapper is used instead of the open(). But when I strace vi I see that the system calls made is to open() (of course including the other system calls). What is the issue here?
I have written wrappers for both open() and open64( ). Now I run vi
Share
The strace utility traces system calls (syscall) and open happens to be both a syscall and a library function. Both the
open()andopen64()library functions use theopensyscall internally to request services from the kernel. It is my understanding that usingopen()with theO_LARGEFILEflag is equivalent to usingopen64()to support large files in 32-bit applications.If the call to
open64()were to call theopen()function internally, youropen()wrapper would not be called because you cannot interpose internal library function calls. They are resolved before runtime.