This content has been marked as final. Show 3 replies
Are you sure that having a multibyte return code (as in larger than 255) does not have special meaning to whatever OS you're running this on? ProcessBuilder is after all very low level and delegates most of its work to the OS.
Exactly. Unix and Linux only support an 8-bit exit code. The top-order 8 bits are reserved for a signal indication.
OK, that explains it. I think we had taken the fact that main() returns and int on *NIX that you could return anything that fit in an int into the exit code. I've now found some corroboration that you can only return a value of 0-255.
This also explains why we have never seen this issue on Windows - apparently you can return much larger values on Windows.
Thanks for the assist!