This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Overriding *fprintf with an LD_PRELOAD
- From: Emil Ong <emilong at cs dot berkeley dot edu>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 26 Jul 2004 09:41:53 -0700
- Subject: Overriding *fprintf with an LD_PRELOAD
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.