file_fd调用之后关闭dup2,而且程序仍然会在默认情况下继续记录到这个文件。甚至我的"dup2 result=1“也会打印到文件中(而不是在stdout上)。如果直接调用已验证的dup2,那么我现在用file_fd (8)和orig_fd (1)的参数调用tracee中的tracee中的tracee:
int err = do_syscall[+] F
但是,当我在fork、child_process和parent_process周围放一个for循环时,dup2函数返回-1,因此程序失败。我做错了什么?这段代码在child_process和parent_process周围有一个parent_process循环,并且与dup2有问题。STDOUT descriptor and replaces it with if (dup2(pipe_pair