ja nie zabardzo rozumiem jak dziala to cale ptrace.
bylbym wdzieczny jak by ktos mi wytlumaczyl jak filtrowac syscalle.
#include <stdio.h>
#include <sys/ptrace.h>
int main(){
int pid;
pid = fork();
if(pid == -1)perror(0);
else{
if(pid == 0){
//child
ptrace(PTRACE_TRACEME, 0, 0, 0);
perror(0);
while(1){
puts("asdfgree543");
sleep(1);
}
}
else{
//parent
printf("PID: %u\r\n", pid);
ptrace(PTRACE_SYSCALL, pid, 0, 0);
perror(0);
sleep(666);
}
}
return 0;
}