What's the XY Problem here? What are you really trying to accomplish? What do you have, and what are you trying to get? Perhaps there is a better way than trying to replace open.
Comment on Re: Interpose system call 'open' using LD_PRELOAD does not work for 'open' called from within perl programs. Why?