I have a parent process which forks out a child to perform execv().
I need the output given by execv() to stdout to be displayed onscreen as also copied to a log file.
How do I write the same output to both stdout & a file, without using pipes or tees?
If you don’t want to use a tee, before you write the data, write it to a file, then send it to stdout.
You should write a logging function that does this for you to make it cleaner.