Overriding *fprintf with an LD_PRELOAD

Emil Ong emilong@cs.berkeley.edu
Tue Jul 27 01:16:00 GMT 2004


Hi,

I'm trying to do some simple logging with an LD_PRELOAD library.  I'd like
to intercept all the reads and writes done by a program.  However,
I'm running into trouble with vfprintf -- it refuses to be overridden.
I had hoped that overriding write/write64 would take care of this case,
but I see that all the internal glibc writes are done via __write.
I tried overriding vfprintf and _IO_vfprintf, but was unsuccessful.
Can anyone point me in the right direction to intercept vfprintf?

Thank you,
Emil Ong

P.S.
I posted this earlier to bug-glibc, but then I saw that this list 
(libc-alpha) is also for user discussion.  I apologize if either
or both of these posts is misplaced.



More information about the Libc-alpha mailing list