Reputation: 2319
When duplicating a file descriptor fd calling dup, and closing the original file descriptors.
Do all the duplicated file descriptors get closed also?
Upvotes: 0
Views: 902
Reputation: 409136
No the duplicates won't be closed. Otherwise the main use-case (duplicating into STDOUT_FILENO
and STDIN_FILENO
) would be pretty useless.
Upvotes: 4