Hi all,I'm reading <Advanced programming in the UNIX environment>,that book asked the reader to implement a function which has same functions with dup2 without calling fcntl.Could anyone give me a tip?Any help will be appreciated.
Printable View
Hi all,I'm reading <Advanced programming in the UNIX environment>,that book asked the reader to implement a function which has same functions with dup2 without calling fcntl.Could anyone give me a tip?Any help will be appreciated.
Read what dup2 does, compared to dup (perhaps?)
Re-read the previous chapter of the book then for more clues, then try the exercise again?
Personally, I fail to see the point of "Do x without using the obvious y to achieve the result" type exercises.
It's like being told how to do a magic trick. The only real fun is figuring it out.