How could you write code to create a child process, but arrange to redirect standard input for the child to come from a file named foo.txt?
That is, the bash shell has to do this if you type:
$ prog < foo.txt