public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* glibc interception problems
@ 2021-05-25  2:30 肖鹏
  2021-05-25  3:10 ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: 肖鹏 @ 2021-05-25  2:30 UTC (permalink / raw)
  To: libc-help

Hi ,


I'm developping a library for a distributed file system, using LD_PRELOAD to intercept file related calls to glibc.
Programs directly using unbuffered IO (close/open/read/write) work well with my library. But programs using buffered IO (fclose/fopen/fread/fwrite) will call unbuffered functions of glibc instead of my library. 
The reason is that in glibc, buffered IO depend on internal symbols, which cannot be intercepted. 
I can see two ways to work around this:
1. Implement buffered IO in my library.
2. Modify glibc buffered IO to use public symbols, and maintain a custom version of glibc.
Both ways have drawbacks. Do you have any suggestions about this?


Thanks very much! Hope for your response.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-26  3:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  2:30 glibc interception problems 肖鹏
2021-05-25  3:10 ` Mike Frysinger
     [not found]   ` <4f73c540.6a6.179a6344524.Coremail.xiaopeng_phy@163.com>
2021-05-26  3:47     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).