[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
overriding system calls
From: |
J . Robert von Behren |
Subject: |
overriding system calls |
Date: |
Wed, 26 Feb 2003 15:38:37 -0800 |
Greetings!
I'm working on a user-level threads package, and would like to override system
calls for read(), write(), etc. for existing apps. I've checked mailing list
archives, the glibc source, and tried out a number of options for both linking
and loading the executables, but can't get things to work in all the
environments I've tried. (It seems to work on machines w/ older versions of
glibc, but not newer versions.) I'm hoping someone wiser than me can point me
in the right direction to find a solution. ;-)
Here's what I've done:
* in my source, define my own read(), write(), etc.
* alias __read() to my read(), etc. with the strong_alias() macro copied
from the glibc source
* run my test app w/ LD_PRELOAD=./my_lib.so testprog
This works with the following setup:
glibc 2.2.5 (debian libc6 2.2.5-11.2)
ld-linux.so.2 -> ld-2.2.5.so (debian libc6 2.2.5-11.2
ld 2.12.90.0.1 (debian binutils 2.12.90.0.1-4)
This setup does _not_ work:
glibc 2.3.1 (debian libc6 2.3.1-13)
ld-linux.so.2 -> ld-2.3.1.so (debian libc6 2.3.1-13)
ld 2.12.90.0.1 (debian binutils 2.12.90.0.1-4)
Is there something different I need to do for this to work with newer versions
of glibc? This feels to me like a FAQ or otherwise dumb question, but I'm at a
loss as to where to look next. If someone could point me in the right
direction, I'd be much obliged! ;-)
Best regards,
-Rob von Behren
P.S. Please send replies directly to me as well as to the list, as I'm not a
subscriber.
Unfortunately, I need to use the newer versions
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- overriding system calls,
J . Robert von Behren <=