SyntaxFix
Write A Post
Hire A Developer
Questions
After forking, use dup2(2) to duplicate the file's FD into stdout's FD, then exec.
dup2(2)