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 fil
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.