O'Reilly logo
  • Aditya Godbole thinks this is interesting:

3.2 Write your own dup2 function that behaves the same way as the dup2 function described in Section 3.12, without calling the fcntl function. Be sure to handle errors correctly.

From

Cover of Advanced Programming in the UNIX® Environment, Third Edition

Note

Exercise