On Mon, Jul 6, 2009 at 11:40 PM, Matthew Fluet <span dir="ltr"><<a href="mailto:fluet@tti-c.org">fluet@tti-c.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Cygwin (with use-mmap false) has a similar diff:</blockquote><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I was happy to ignore it, since it is clearly due to a difference in interpretation of exit codes when using GetExitCodeProcess. One could go through the effort of searching the Cygwin source for how they translate from a GetExitCodeProcess exit code to a Posix style exit code, but I wasn't sure it was worth the effort.<br>
</blockquote></div><br>I'm not even sure that's how it works on cygwin. I have vague recollections of cygwin using a pipe mechanism to convey signal information. TerminateProcess doesn't inter-operate with signal(); it's like kill -9 where you get to pick the exit status. <br>
<br>One could imagine emulating unix behaviour with CreateRemoteThread combined with DLL injection / VirtualAllocEx / WriteProcessMemory. Windows APIs are sick.<br><br>Anyway, I think the important thing is that you can now kill a spawned process under MinGW, something that was clearly missing. I'm not sure my hack to convey 'killed by signal' was a good idea, but it gets the job done where MLton is the parent process (spawning, killing, and reaping).<br>
<br>