[phobos] Major improvements to std.process
Steve Schveighoffer
schveiguy at yahoo.com
Fri Mar 12 05:36:37 PST 2010
This is a perfect solution, as I think it's similar to what Windows does. If Windows is terminated by an unhandled exception, then it returns the exception number. I don't think this always happens correctly. For instance, I think if you terminate a process via program manager, it just exits with a 0 (I never trust exit codes from programs on Windows anyways, there seems to be a lack of respect for it among windows developers). But at least we get a best effort for all OSes.
Thanks!
-Steve
----- Original Message ----
> From: Lars Tandle Kyllingstad <lars at kyllingen.net>
>
> Steve Schveighoffer wrote:
> > The signal termination aspect of wait is not portable to Windows. Should we
> put a note that the function only occurs on POSIX systems, or is that enough to
> remove the feature?
>
> Is there no way of detecting abnormal termination, such as a process being
> killed by the process manager?
>
> If not, then we can do what is currently done in std.process, namely
>
> if (terminatedNormally) return exitCode;
> else if (terminatedBySignal) return -signal;
>
> This works because POSIX exit codes are restricted to the range 0-255.
>
> -Lars
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list