rust/library
Ayush Singh a404015775
std: sys: process: uefi: Use NULL stdin by default
According to the docs in `Command::output`:

> By default, stdout and stderr are captured (and used to provide the
resulting output). Stdin is not inherited from the parent and any attempt
by the child process to read from the stdin stream will result in the
stream immediately closing.

This was being violated by UEFI which was inheriting stdin by default.

While the docs don't explicitly state that the default should be NULL,
the behaviour seems like reading from NULL.

UEFI however, has a bit of a problem. The `EFI_SIMPLE_TEXT_INPUT_PROTOCOL`
only provides support for reading 1 key press. This means that you
either get an error, or it is assumed that the keypress was read
successfully. So there is no way to have a successful read of length 0.
Currently, I am returning UNSUPPORTED error when trying to read from
NULL stdin. On linux however, you will get a read of length 0 for Null
stdin.

One possible way to get around this is to translate one of the UEFI
errors to a read 0 (Maybe unsupported?). It is also possible to have a
non-standard error code, but well, not sure if we go that route.

Alternatively, if meaning of Stdio::Null is platform dependent, it
should be fine to keep the current behaviour of returning an error.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-13 23:22:58 +05:30
..
alloc Fix testing with randomized layouts enabled 2025-04-03 15:30:01 +00:00
alloctests Rollup merge of #138546 - GuillaumeGomez:integer-to-string-tests, r=Amanieu 2025-04-05 13:18:14 +11:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #139123 - thaliaarchi:core-alloc-test-paths, r=bjorn3 2025-04-06 16:21:02 +10:00
coretests tidy: Fix paths to coretests and alloctests 2025-04-05 12:15:49 -07:00
panic_abort Migrate panic_abort to Rust 2024 2025-03-11 09:46:34 -07:00
panic_unwind Mark imports of #[rustc_std_internal_symbol] items with this attribute 2025-03-17 14:06:56 +00:00
portable-simd Merge commit 'c14f2fc3eb69c164d8bf8d36d91ebd60bd5261e6' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro allow wasm_c_abi in proc_macro bridge 2025-03-25 08:22:35 +01:00
profiler_builtins Migrate profiler_builtins to Rust 2024 2025-03-11 09:46:35 -07:00
rtstartup Revert changes for rtstartup 2025-03-10 21:23:31 +08:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std std: sys: process: uefi: Use NULL stdin by default 2025-04-13 23:22:58 +05:30
stdarch@9426bb5658 Update stdarch 2025-03-06 11:11:55 -08:00
sysroot Migrate the sysroot crate to Rust 2024 2025-03-11 09:46:35 -07:00
test Migrate test to Rust 2024 2025-03-11 09:46:34 -07:00
unwind Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboet 2025-03-17 05:47:49 -04:00
windows_targets Migrate windows-targets to Rust 2024 2025-03-11 09:46:35 -07:00
Cargo.lock compiler and tools dependencies 2025-04-01 20:48:17 +00:00
Cargo.toml Add opt-level = "s" for more std symbolication crates 2025-04-01 20:50:19 +00:00