equal
deleted
inserted
replaced
|
1 This should demonstrate the use of LD_PRELOAD. |
|
2 |
|
3 hallo: uses virgin puts(3) and readdir(3) |
|
4 myhallo: uses modified puts(3) and readdir(3) |
|
5 |
|
6 If you set the environment |
|
7 |
|
8 LD_PRELOAD=`pwd`/libmy.so.1.0.1 |
|
9 |
|
10 the "hallo" should use the modified versions of the above |
|
11 funtions too. |
|
12 |
|
13 The modification is visibable, as puts(3) prints an |
|
14 extra string before the real output, and readdir(3) skips |
|
15 any directory entry starting with 'M'. |
|
16 |
|
17 No considerations done about race conditions and other nice things. |
|
18 It is just an nice example… |
|
19 |
|
20 -- |
|
21 Heiko Schlittermann |