This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]