Can C be used to capture system calls on a machine?
Good day,
I was wondering if there is a way to do direct system call capture with C or C++?
I know that currently on unix systems you can use SystemTap to do system capture. The problem I'm having is that in order to feed them into another program for analysis I have to pipe them to the other program.
I'd like to pass things along programatically as this is easier than开发者_JS百科 "printing" out into the pipe and then reading in with the other program.
Is there a way of doing this? How difficult would it be?
strace does exactly that.
You can take a look at its source code to see how its done.
精彩评论