Is it necessary to replace stdin
with a pipe
end when using pipes?
I have an application that:-
- Creates a pipe,
- Forks a child process, and then
- execl() a new process image within new child process,
But I'm running into two conceptual issues.
Is it necessary to use
dup()
ordup2()
to replacestdin
? It would obviously be easier to just use thefd
from the pipe. (I need little insight about this)If you can just use the
fd
from the pipe, how do you pass an integerfd
usingexecl()
when execl takeschar *
arguments?
I'm having trouble figuring out exactly what remains open after execl() is performed, and how to access that information from the newly execl'd process.