3

Add From<u8> for ExitCode by yaahc · Pull Request #93445 · rust-lang/rust...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/93445
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Member

yaahc commented 20 days ago

edited

This should cover a mostly cross-platform subset of supported exit codes.

We decided to stick with u8 initially since its the common subset between all platforms that we support (excluding wasm which I think only works with true or false). Posix is supposed to take i32s, but in practice many unix platforms mask out all but the low 8 bits or in some cases the 8-15th bits. Windows takes a u32 instead of an i32. Bourne-compatible shells also report signals as exitcode 128 + signal_no, so there's some ambiguity there when returning exit codes > 127, but it is possible to disambiguate them on the other side so we decided against restricting the possible codes further than to u8.

Related


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK