Message137660
Although Windows fds are not inheritable, the handles associated with fds can be made inheritable.
A workaround for the fact fds are not inheritable is the following pattern:
1) The parent process converts the fd to a handle using _get_osfhandle(fd).
2) The parent process makes the handle inheritable (if it is not already) using SetHandleInformation() or DuplicateHandle().
3) The parent process starts the child process and passes the handle number on the commandline.
4) The child process gets the handle number by parsing the commandline.
5) The child process uses _open_osfhandle(handle, flags) to convert the handle into an fd.
Note that Python has open_osfhandle() and get_osfhandle() in the msvcrt module. In C, _open_osfhandle() and _get_osfhandle() are declared in io.h. |
|
Date |
User |
Action |
Args |
2011-06-04 19:31:04 | sbt | set | recipients:
+ sbt, amaury.forgeotdarc, brian.curtin, 3vi1 |
2011-06-04 19:31:03 | sbt | set | messageid: <1307215863.92.0.44193118576.issue12262@psf.upfronthosting.co.za> |
2011-06-04 19:31:02 | sbt | link | issue12262 messages |
2011-06-04 19:31:02 | sbt | create | |
|