Override system function

From: Darkone (degrade_at_msn.com)
Date: 11/03/04


Date: 3 Nov 2004 05:49:06 -0800

I need to override open() and close() system functions.
I have read about writing a LKM to do this, but this will only work
under 2.4 kernels and kernels with LKM support.
I also read about using LD_PRELOAD but this leads to the problem of
how to call the original (real) open() which I will also need to do.

Therefore, I would like to know if anyone knows how I can achieve
this?

So if LD_PRELOAD is the way to go then how do I get the original
open()?

Under Mac OS X and Windows I am finding the address of the real open
function and changing the first instruction to branch to a new area of
memory which can also re-enter the original.
Problem is I dont know enough about Linux and the system functions to
know if this is possible on Linux?



Relevant Pages

  • Re: Creating ramdisk at runtime
    ... >> I'm porting a program from vxWorks to Linux right now. ... >> given program there is a function which creates a ramdisk at ... >> system functions. ...
    (comp.os.linux.development.system)
  • Re: Creating ramdisk at runtime
    ... > I'm porting a program from vxWorks to Linux right now. ... > given program there is a function which creates a ramdisk at ... > system functions. ...
    (comp.os.linux.development.system)