Preloading my library for a few functions while using the original by others using LD_PRELOAD
I have written a wrapper for the open() syscall and preload it using the LD_PRELOAD environment variable. I want only a few functions of the program to use the modified open() whereas others would use the original. Separating the functions in two programs is not an option as one calls the other. How can it be done? jschmier The use of function interposition in the following example is similar to this answer . The example provides a write() wrapper function that calls the original write() . It is important to note that you cannot directly call the original write() because it will be interpreted