I am porting a code from windows to linux. I have this code
// We want a non-inherited read handle. DuplicateHandle with a
// NULL target fixes the read side to be non-inheritable
::DuplicateHandle(::GetCurrentProcess(), // in this process
hStdOutR, // child read handle
::GetCurrentProcess(), // to this process
NULL, // modify existing handle
0, // flags
FALSE, // not inheritable
DUPLICATE_SAME_ACCESS); // same handle access*/
If I want the same functionality to be achieved in Linux, what could be done?