Quote:
Originally Posted by
frequency8
Anyhow, I was wondering if using dup2() in the following snippet was a legal close-on-exec move.
Eh?
0 == STDIN_FILENO
and
1 == STDOUT_FILENO
so what are you trying to achieve?
I would only call dup2 if the file descriptors were different.
Yes, if a file descriptor has the close on exec bit set, they will be closed when exec() is called, otherwise I'm not sure what you are getting at.