Intercepting system calls
I want to intercept system calls that are provided
for IPC in Linux. I have to determine whether a process blocks while executing a system call and I must save the arguments passed to that system call.
Can I modify the system call source code directly
for this? or if I want the system calls to refer my module, how should I do that? can anyone explain for this, if possible with some code?..
Thanks,
selva
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
Quoted 2 lines · selvakumar nagendran
Can I modify the system call source code directly
for this?
Yes.
Quoted 2 lines
or if I want the system calls to refer my
module, how should I do that?
EXPORT_SYMBOL
Lee
Quoted 8 lines · selvakumar nagendran
I want to intercept system calls that are provided
for IPC in Linux. I have to determine whether a process blocks while executing a system call and I must save the arguments passed to that system call.
Can I modify the system call source code directly
for this? or if I want the system calls to refer my module, how should I do that? can anyone explain for this, if possible with some code?..
Do you have to do this in the kernel? Have you taken a look at ptrace? Especially PTRACE_SYSCALL (man ptrace). Although it may be trickier to know if it blocked or not, but it should still be possible to do entirely from user land, and thus easier to write/debug.
-- Steve