Send messages from child process to parent
问题 I am executing the parent code. I then do a fork and then execvpe. The new program that i "execvpe" throws a lot of console messages and i want to hide those. Is it possible for me to redirect all my stdout and stderr messages in the child process onto a file? I tried a close(1) so that i dont dump messages on console (stdout) and that didnt help 回答1: pid_t pid = fork(); /* Child process */ if (pid == 0) { /* Open log file */ int log = creat("logfile", 0644); /* Redirect stdout to log file */