Some relevant reference and code over at stackoverflow:
http://stackoverflow.com/questions/5713242/linux-fork-file-descriptors-inheritance
Some relevant reference and code over at stackoverflow:
http:// stackoverflow. com/questions/ 5713242/ linux-fork- file-descriptor s-inheritance