开发者

Can C be used to capture system calls on a machine?

开发者 https://www.devze.com 2023-03-05 15:48 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消