Closed
Description
The document said:
/// Due to [platform-specific behavior], the exit code for this example will be
/// `0` on Linux, but `256` on Windows:
///
/// ```no_run
/// use std::process;
///
/// process::exit(0x0f00);
/// ```
However from the text above, line process::exit(0x0f00);
should be changed to process::exit(0x0100);
. On Windows, all 32 bits of the exit code is available. See the document of ExitProcess()
for more details. (The parameter of ExitProcess()
is a UINT
, which maps to a C unsigned int
on Windows platforms, which usually is a 32-bit unsigned integer today. The 32-bit 0x0f00 is 3840, not 256.)
Metadata
Metadata
Assignees
Labels
No labels