[MLton] MinGW hosted MLton
Wesley W. Terpstra
wesley@terpstra.ca
Mon, 2 May 2005 23:12:01 +0200
On Mon, May 02, 2005 at 12:21:30PM -0700, Stephen Weeks wrote:
> > 0. 'wait' is reported unused by MLton, but if removed it fails to
> > build
>
> That it is unused makes sense, because, you removed the only use when
> you changed the definition of OS.Process.system. It fails to build
> because the signature constraint OS_PROCESS_EXTRA requires wait. This
> is clearly no longer needed, so I took wait out of the signature, and
> things compile fine.
I thought OS_PROCESS_EXTRA was exported somewhere, that's why I left it.
Removing it sounds good to me!
> * In the definition of OS.Process.system, why do you think it's OK to
> remove the signal handler stuff that causes SIGINT and SIGQUIT to be
> ignored? In all honesty, I don't know why it was there, except that
> it was probably inherited from SML/NJ. But not knowing makes me
> hesitant to remove it.
I switched to using system() b/c there is no /bin/sh on windows. :-)
If you read the manpage for system() it says that SIGCHLD will be blocked
and SIGINT and SIGQUIT will be ignored. I presume that SML/NJ was trying to
fake a proper system call. However, since we are using a real system call
now, I don't think that it is necessary to do this ourselves...?
Under windows, of course, this is all irrelevant as there are no signals.
(That's why I don't/can't use protect in the waitpid->cwait method...)
> * In main.fun, you changed the default MinGW temp directory from
> "C:/WINNT/TEMP" to "C:/WINDOWS/TEMP". This seems like a better
> choice because it will work on more machines, although I wonder if
> there isn't a more portable (across versions of Windows) solution.
The environment variable TEMP is used and the above is a fallback.
So, yes, there is a more portable thing to do: use TEMP. :-)
I just thought WINNT was a bad fallback, so changed it.
--
Wesley W. Terpstra <wesley@terpstra.ca>