[MLton] interrupted system call

Stephen Weeks MLton@mlton.org
Fri, 26 Mar 2004 11:24:41 -0800


> Sorry, I haven't been following everything here.  Is the `Signal.restart' flag
> a notion of being able to specify if we want signals to have the SA_RESTART
> flag either on or off?  

Kind of.  It controls whether our SML library automatically restarts
system calls that are interrupted by signals.

> If so then I guess it is sufficient, but very very counter-intuitive
> and not what you see in C.  The point is that in C I expect my
> handler to run quite soon after the signal arrives. 

Right.  If you want this, then you have to deal with interrupted
system calls.  The idea is that a commonly useful simplifying
assumption is that system calls are not interrupted.  So we have both,
with the default being the simple case.

> I should probably re-read `The Rise of "Wirse is Better"' by Gabriel to
> remember what he says about the `PC loser-ing' problem, which is all about
> system calls returning EINTR in Unix.

Please let us know what you learn.