[MLton] test-{create,spawn} fail(?) on MinGW

Wesley W. Terpstra wesley at terpstra.ca
Mon Jul 6 15:11:13 PDT 2009


On Mon, Jul 6, 2009 at 11:40 PM, Matthew Fluet <fluet at tti-c.org> wrote:

> Cygwin (with use-mmap false) has a similar diff:



> 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.
>

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.

One could imagine emulating unix behaviour with CreateRemoteThread combined
with DLL injection / VirtualAllocEx / WriteProcessMemory. Windows APIs are
sick.

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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20090707/c166d2f7/attachment.html


More information about the MLton mailing list