Grabbing output from exec
You have to create a pipe from the parent process to the child, using pipe(). Then you must redirect standard ouput (STDOUT_FILENO) and error output (STDERR_FILENO) using dup or dup2 to the pipe, and in the parent process, read from the pipe. It should work. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define die(e) do { … Read more