This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
More spawn & Windows processes
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin-developers at cygwin dot com
- Date: Sun, 26 Dec 2004 12:45:58 -0500
- Subject: More spawn & Windows processes
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