Subject: bug#6430: Emacs WINDOWS truncates exit status of processes to 8 bits

From: Óscar Fuentes <[email-masked]>
Date: Wed, 15 Jun 2016 21:32:04 +0200

Eli Zaretskii <[email-masked]> writes:

>> A process can return any value on the 32 bit range.
>
> It can, but using those 2 bits for that would be silly, because doing
> so will cause the exit code be interpreted as exit due to a fatal
> error.

AFAIU Emacs currently picks apart the higher bits that (by convention)
signals the fatal/special condition, keeps the lower 8 bits as the
reported exit code and throws away the rest. The point is that the Elisp
code that invoked the external program is not receiving the exit code of
the program, but some part of it. If the external program uses exit
codes above 255 (apart from the "fatal" ones that Emacs detects), the
exit code reported to Elisp is useless, at best.

Personally I don't care, because I live on a world of cross-platform
software, but it was surprising to learn about this limitation of
process handling on Windows, considering how much work was invested on
making Emacs a true Windows citizen.