See SetHandleInformation() and HANDLE_FLAG_INHERIT
That won't work as it only affects the inheritance of handles across CreateProcess() calls; not the CreateThread() calls that underly fork on Windows.
In reply to Re^2: File handles with forked processes (SetHandleInformation)
by BrowserUk
in thread File handles with forked processes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |