More spawn & Windows processes

Pierre A. Humblet Pierre.Humblet@ieee.org
Sun Dec 26 17:51:00 GMT 2004


Chris,

With the recent changes I think that spawn(P_DETACH) should
be fine. However neither spawn(P_WAIT) nor spawn(P_NOWAIT)
will handle Windows processes correctly: the exit status
will not be passed.

If it was only for P_WAIT, we could simply create a subproc_ready
event in that case and reuse child_info::sync.
synch is called from spawn_guts, which will wait for the Windows
process to finish, and all will be fine.
However we can't let spawn_guts wait in the P_NOWAIT case.

One way out is to move the child_info::sync functionality to
the beginning of the proc_waiter thread. Before trying to read
the pipe, it would WaitFor(subproc_ready, process) and set the
exitstatus if needed.
The nice thing is that this will also handle the EXEC and
P_DETACH cases.
If we do that we should look into moving the subproc_ready
event to the pinfo.

Pierre  



More information about the Cygwin-developers mailing list