Re: Intercepting system calls

From: J. R. Okajima
Date: Fri Dec 23 2011 - 02:36:57 EST



Hello Gaurav,

Gaurav Saxena:
> I am writing an application for which I need to intercept some
> filesystem system calls eg. unlink. I need unlink to call my code
:::

For kernel space, CONFIG_KPROBES may help you.
See Documentation/kprobes.txt in detail.

For user space, $LD_PRELOAD may help you.
You will need to develop your shared object library which contains
your_unlink() and replaces the original unlink().
See ld.so(8) manual page.


J. R. Okajima
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/